|
@@ -0,0 +1,120 @@
|
|
|
+using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
+using System;
|
|
|
+using WSUniversalLib;
|
|
|
+
|
|
|
+namespace UnitTest1
|
|
|
+{
|
|
|
+ [TestClass]
|
|
|
+ public class GetPriorityForAgent
|
|
|
+ {
|
|
|
+ [TestMethod]
|
|
|
+ public void GetTest1()
|
|
|
+ {
|
|
|
+ int productType = 3, materialType = 7, count = 15, expected = 326;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ [TestMethod]
|
|
|
+ public void GetTest2()
|
|
|
+ {
|
|
|
+ int productType = 9, materialType = 33, count = 85, expected = 124;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest3()
|
|
|
+ {
|
|
|
+ int productType = 16, materialType = 1, count = 30, expected = 34;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ [TestMethod]
|
|
|
+ public void GetTest4()
|
|
|
+ {
|
|
|
+ int productType = 93, materialType = 13, count = 50, expected = 40;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest5()
|
|
|
+ {
|
|
|
+ int productType = 9, materialType = 1, count = 9, expected = 20;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest6()
|
|
|
+ {
|
|
|
+ int productType = 30, materialType = 17, count = 129, expected = 2;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest7()
|
|
|
+ {
|
|
|
+ int productType = 53, materialType = 79, count = 52, expected = 120;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest8()
|
|
|
+ {
|
|
|
+ int productType = 3, materialType = 124, count = 90, expected = 2;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest9()
|
|
|
+ {
|
|
|
+ int productType = 34, materialType = 16, count = 27, expected = 34;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest10()
|
|
|
+ {
|
|
|
+ int productType = 10, materialType = 31, count = 45, expected = 15;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest11()
|
|
|
+ {
|
|
|
+ int productType = 34, materialType = 13, count = 014, expected = 458;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest12()
|
|
|
+ {
|
|
|
+ int productType = 04, materialType = -34, count = -2, expected = 22250;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest13()
|
|
|
+ {
|
|
|
+ int productType = 34, materialType = 17, count = -39, expected = 8851;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest14()
|
|
|
+ {
|
|
|
+ int productType = 540, materialType = -1, count = 045, expected = 06532;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ public void GetTest15()
|
|
|
+ {
|
|
|
+ int productType = 64, materialType = 157, count = 64, expected = -26;
|
|
|
+ float width = 20, length = 45;
|
|
|
+ int actual = Calculation.GetQuantityForAgent(productType, materialType, count, width, length);
|
|
|
+ Assert.AreEqual(expected, actual);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|