|
@@ -0,0 +1,175 @@
|
|
|
|
+using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
+using System;
|
|
|
|
+using WSUniversalLib;
|
|
|
|
+namespace UnitTest
|
|
|
|
+{
|
|
|
|
+ [TestClass]
|
|
|
|
+ public class CalculationTest
|
|
|
|
+ {
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_AgentTypeEasyTest1()
|
|
|
|
+ {
|
|
|
|
+ int rezult = -1;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(5, 24, 10);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_YongAgentTypeEasyTest2()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 4;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(1, 23, 2);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_YongAgentType1EasyTest3()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 5;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(1, 23, 2);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_YongAgentTypeEasyTest4()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 5;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(2, 23, 2);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_YongAgentTypeEasyTest5()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 5;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(6, 5, 4);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_AgentTypeEasyTest6()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 35;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(3, 11, 22);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_AgentTypeEasyTest7()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 42;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(2, 35, 21);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_AgentTypeEasyTest8()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 122;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(1, 55, 45);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_AgentTypeEasyTest9()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 348;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(1, 55, 45);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_AgentTypeEasyTest10()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 59;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(2, 35, 16);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_YoungAgentTypeHardTest1()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 9;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(1, (float)21.5, (float)1.5);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_YoungAgentTypeHardTest2()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 11;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(3, (float)21.5, (float)2.5);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_AgentTypeHardTest3()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 29;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(1, (float)33.7, (float)12.7);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_AgentTypeHardTest4()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 199;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(2, (float)45.7, (float)27.2);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ public void Check_AgentTypeHardTest5()
|
|
|
|
+ {
|
|
|
|
+ int rezult = 444;
|
|
|
|
+
|
|
|
|
+ Calculation calc = new Calculation();
|
|
|
|
+ int actual = calc.GetPriorityForAgent(3, (float)66.6, (float)55.5);
|
|
|
|
+
|
|
|
|
+ Assert.AreEqual(rezult, actual);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|