using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using WSUniversalLib; namespace WSUniversalLibUnitTests { [TestClass] public class UnitTests { Calculation calculationClass = new Calculation(); [TestMethod] public void GetPriorityForAgent_NonExistentAgentType() { int result = calculationClass.GetPriorityForAgent(5, 25, 1.6f); Assert.AreEqual(-1, result); } [TestMethod] public void GetPriorityForAgent_UnrealAge() { int result = calculationClass.GetPriorityForAgent(2, 999, 1.6f); Assert.AreEqual(-1, result); } [TestMethod] public void GetPriorityForAgent_ExperienceMoreThanAge() { int result = calculationClass.GetPriorityForAgent(1, 25, 50); Assert.AreEqual(-1, result); } [TestMethod] public void GetPriorityForAgent_ExperienceIsZero() { int result = calculationClass.GetPriorityForAgent(1, 25, 0); Assert.AreEqual(-1, result); } [TestMethod] public void GetPriorityForAgent_AgeIsZero() { int result = calculationClass.GetPriorityForAgent(1, 0, 5); Assert.AreEqual(-1, result); } [TestMethod] public void GetPriorityForAgent_SimpleValues_01() { int result = calculationClass.GetPriorityForAgent(1, 30, 3); Assert.AreEqual(5, result); } [TestMethod] public void GetPriorityForAgent_SimpleValues_02() { int result = calculationClass.GetPriorityForAgent(3, 45, 13); Assert.AreEqual(60, result); } [TestMethod] public void GetPriorityForAgent_SimpleValues_03() { int result = calculationClass.GetPriorityForAgent(2, 35, 22); Assert.AreEqual(86, result); } [TestMethod] public void GetPriorityForAgent_SimpleValues_04() { int result = calculationClass.GetPriorityForAgent(1, 20, 1); Assert.AreEqual(2, result); } [TestMethod] public void GetPriorityForAgent_SimpleValues_05() { int result = calculationClass.GetPriorityForAgent(3, 23, 2); Assert.AreEqual(9, result); } [TestMethod] public void GetPriorityForAgent_FloatValues_01() { int result = calculationClass.GetPriorityForAgent(1, 25, 2.7f); Assert.AreEqual(5, result); } [TestMethod] public void GetPriorityForAgent_FloatValues_02() { int result = calculationClass.GetPriorityForAgent(2, 62, 40.6f); Assert.AreEqual(166, result); } [TestMethod] public void GetPriorityForAgent_FloatValues_03() { int result = calculationClass.GetPriorityForAgent(3, 68, 47.6f); Assert.AreEqual(238, result); } [TestMethod] public void GetPriorityForAgent_FloatValues_04() { int result = calculationClass.GetPriorityForAgent(2, 29, 8.3f); Assert.AreEqual(27, result); } [TestMethod] public void GetPriorityForAgent_FloatValues_05() { int result = calculationClass.GetPriorityForAgent(1, 25, 2.5f); Assert.AreEqual(5, result); } } }