CalculationTest.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using WSUniversalLib;
  4. namespace UnitTestCalculation
  5. {
  6. [TestClass]
  7. public class CalculationTest
  8. {
  9. [TestMethod]
  10. public void Check_AgentTypeNonExist()
  11. {
  12. int rezult = -1;
  13. Calculation calc = new Calculation();
  14. int actual = calc.GetPriorityForAgent(4, 32, 14);
  15. Assert.AreEqual(rezult, actual);
  16. }
  17. [TestMethod]
  18. public void Check_YongAgentTypeNonExist()
  19. {
  20. int rezult = -1;
  21. Calculation calc = new Calculation();
  22. int actual = calc.GetPriorityForAgent(4, 21, 1);
  23. Assert.AreEqual(rezult, actual);
  24. }
  25. [TestMethod]
  26. public void Check_YongAgnetType1EasyTest()
  27. {
  28. int rezult = 4;
  29. Calculation calc = new Calculation();
  30. int actual = calc.GetPriorityForAgent(1, 23, 2);
  31. Assert.AreEqual(rezult, actual);
  32. }
  33. [TestMethod]
  34. public void Check_YongAgnetType2EasyTest()
  35. {
  36. int rezult = 7;
  37. Calculation calc = new Calculation();
  38. int actual = calc.GetPriorityForAgent(2, 23, 2);
  39. Assert.AreEqual(rezult, actual);
  40. }
  41. [TestMethod]
  42. public void Check_YongAgnetType3EasyTest()
  43. {
  44. int rezult = 9;
  45. Calculation calc = new Calculation();
  46. int actual = calc.GetPriorityForAgent(3, 23, 2);
  47. Assert.AreEqual(rezult, actual);
  48. }
  49. [TestMethod]
  50. public void Check_AgentType1Exp12EasyTest()
  51. {
  52. int rezult = 28;
  53. Calculation calc = new Calculation();
  54. int actual = calc.GetPriorityForAgent(1, 32, 12);
  55. Assert.AreEqual(rezult, actual);
  56. }
  57. [TestMethod]
  58. public void Check_AgentType2Exp21EasyTest()
  59. {
  60. int rezult = 82;
  61. Calculation calc = new Calculation();
  62. int actual = calc.GetPriorityForAgent(2, 35, 21);
  63. Assert.AreEqual(rezult, actual);
  64. }
  65. [TestMethod]
  66. public void Check_AgentType3Exp40EasyTest()
  67. {
  68. int rezult = 200;
  69. Calculation calc = new Calculation();
  70. int actual = calc.GetPriorityForAgent(3, 55, 40);
  71. Assert.AreEqual(rezult, actual);
  72. }
  73. [TestMethod]
  74. public void Check_AgentType1Exp45EasyTest()
  75. {
  76. int rezult = 122;
  77. Calculation calc = new Calculation();
  78. int actual = calc.GetPriorityForAgent(1, 55, 45);
  79. Assert.AreEqual(rezult, actual);
  80. }
  81. [TestMethod]
  82. public void Check_AgentType2Exp16EasyTest()
  83. {
  84. int rezult = 59;
  85. Calculation calc = new Calculation();
  86. int actual = calc.GetPriorityForAgent(2, 35, 16);
  87. Assert.AreEqual(rezult, actual);
  88. }
  89. [TestMethod]
  90. public void Check_YongAgnetType1HardTest()
  91. {
  92. int rezult = 3;
  93. Calculation calc = new Calculation();
  94. int actual = calc.GetPriorityForAgent(1, (float)21.5, (float) 1.5);
  95. Assert.AreEqual(rezult, actual);
  96. }
  97. [TestMethod]
  98. public void Check_YongAgnetType3HardTest()
  99. {
  100. int rezult = 11;
  101. Calculation calc = new Calculation();
  102. int actual = calc.GetPriorityForAgent(3, (float)21.5, (float)2.5);
  103. Assert.AreEqual(rezult, actual);
  104. }
  105. [TestMethod]
  106. public void Check_AgnetType1HardTest()
  107. {
  108. int rezult = 29;
  109. Calculation calc = new Calculation();
  110. int actual = calc.GetPriorityForAgent(1, (float)33.7, (float)12.7);
  111. Assert.AreEqual(rezult, actual);
  112. }
  113. [TestMethod]
  114. public void Check_AgnetType2HardTest()
  115. {
  116. int rezult = 106;
  117. Calculation calc = new Calculation();
  118. int actual = calc.GetPriorityForAgent(2, (float)45.7, (float)27.2);
  119. Assert.AreEqual(rezult, actual);
  120. }
  121. [TestMethod]
  122. public void Check_AgnetType3HardTest()
  123. {
  124. int rezult = 213;
  125. Calculation calc = new Calculation();
  126. int actual = calc.GetPriorityForAgent(3, (float)55.9, (float)42.6);
  127. Assert.AreEqual(rezult, actual);
  128. }
  129. }
  130. }