123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using System;
- using WSUniversalLib;
- namespace UnitTestProject1
- {
- [TestClass]
- public class UnitTest1
- {
- Calculation cl = new Calculation();
- [TestMethod]
- public void GetPriorityFirstClass_YoungAgent()
- {
- int i = cl.GetPriorityForAgent(1, 10, 2);
- Assert.AreEqual(4, i);
- }
- [TestMethod]
- public void GetPriorityFirstClass_RegularAgent()
- {
- int i = cl.GetPriorityForAgent(1, 25, 4);
- Assert.AreEqual(7, i);
- }
- [TestMethod]
- public void GetPriorityFirstClass_ExpiriencedAgent_First()
- {
- int i = cl.GetPriorityForAgent(1, 10, 11);
- Assert.AreEqual(25, i);
- }
- [TestMethod]
- public void GetPriorityFirstClass_ExpiriencedAgent_Second()
- {
- int i = cl.GetPriorityForAgent(1, 10, 22);
- Assert.AreEqual(55, i);
- }
- [TestMethod]
- public void GetPriorityFirstClass_ExpiriencedAgent_Third()
- {
- int i = cl.GetPriorityForAgent(1, 10, 44);
- Assert.AreEqual(110, i);
- }
- [TestMethod]
- public void GetPrioritySecondClassAgent()
- {
- int i = cl.GetPriorityForAgent(2, 26, 4);
- Assert.AreEqual(13, i);
- }
- [TestMethod]
- public void GetPriorityThirdClassAgent()
- {
- int i = cl.GetPriorityForAgent(3, 26, 4);
- Assert.AreEqual(16, i);
- }
- [TestMethod]
- public void GetPrioritySecondClass_YoungAgent()
- {
- int i = cl.GetPriorityForAgent(2, 10, 2);
- Assert.AreEqual(7, i);
- }
- [TestMethod]
- public void GetPriorityThirdClass_YoungAgent()
- {
- int i = cl.GetPriorityForAgent(3, 10, 2);
- Assert.AreEqual(9, i);
- }
- [TestMethod]
- public void GetPrioritySecondClass_ExperiencedAgent()
- {
- int i = cl.GetPriorityForAgent(2, 10, 11);
- Assert.AreEqual(41, i);
- }
- [TestMethod]
- public void GetPriority_WrondClass()
- {
- int i = cl.GetPriorityForAgent(-1, 10, 11);
- Assert.AreEqual(-1, i);
- }
- [TestMethod]
- public void GetPriority_WrongAge()
- {
- int i = cl.GetPriorityForAgent(2, -1, 11);
- Assert.AreEqual(-1, i);
- }
- [TestMethod]
- public void GetPriority_WrongExpirience()
- {
- int i = cl.GetPriorityForAgent(2, 10, -1);
- Assert.AreEqual(-1, i);
- }
- [TestMethod]
- public void GetPriority_CalculatingClass()
- {
- int i = cl.GetPriorityForAgent(4-2, 10, 11);
- Assert.AreEqual(41, i);
- }
- [TestMethod]
- public void GetPriority_WrongCalculatingClass()
- {
- int i = cl.GetPriorityForAgent(2-4, 10, 11);
- Assert.AreEqual(-1, i);
- }
- }
- }
|