EasyTest.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using WSUniversalLib;
  4. namespace UnitTest
  5. {
  6. [TestClass]
  7. public class EasyTest
  8. {
  9. [TestMethod]
  10. public void GetPriorityForAgent_UsusalValue()
  11. {
  12. int actual, expented;
  13. actual = Calculation.GetPriorityForAgent(2, 23, 1.5f);
  14. expented = 5;
  15. Assert.AreEqual(expented, actual);
  16. }
  17. [TestMethod]
  18. public void GetPriorityForAgent_NegatineValueAge()
  19. {
  20. int actual, expented;
  21. actual = Calculation.GetPriorityForAgent(2, -23, 1.5f);
  22. expented = -1;
  23. Assert.AreEqual(expented, actual);
  24. }
  25. [TestMethod]
  26. public void GetPriorityForAgent_NegatineValueExp()
  27. {
  28. int actual, expented;
  29. actual = Calculation.GetPriorityForAgent(2, 23, -1.5f);
  30. expented = -1;
  31. Assert.AreEqual(expented, actual);
  32. }
  33. [TestMethod]
  34. public void GetPriorityForAgent_NegatineValueType()
  35. {
  36. int actual, expented;
  37. actual = Calculation.GetPriorityForAgent(-2, 23, 1.5f);
  38. expented = -1;
  39. Assert.AreEqual(expented, actual);
  40. }
  41. [TestMethod]
  42. public void GetPriorityForAgent_FloatValueAge()
  43. {
  44. int actual, expented;
  45. actual = Calculation.GetPriorityForAgent(2, 20.2f, 1);
  46. expented = 3;
  47. Assert.AreEqual(expented, actual);
  48. }
  49. [TestMethod]
  50. public void GetPriorityForAgent_BigAge()
  51. {
  52. int actual, expented;
  53. actual = Calculation.GetPriorityForAgent(2, 45, 1);
  54. expented = 4;
  55. Assert.AreEqual(expented, actual);
  56. }
  57. [TestMethod]
  58. public void GetPriorityForAgent_BigExp()
  59. {
  60. int actual, expented;
  61. actual = Calculation.GetPriorityForAgent(2, 30, 10);
  62. expented = 41;
  63. Assert.AreEqual(expented, actual);
  64. }
  65. [TestMethod]
  66. public void GetPriorityForAgent_ZeroExp()
  67. {
  68. int actual, expented;
  69. actual = Calculation.GetPriorityForAgent(2, 30, 0);
  70. expented = -1;
  71. Assert.AreEqual(expented, actual);
  72. }
  73. }
  74. }