CalculationTests.cs 4.5 KB

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