123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using System;
- using WSUniversalLib;
- namespace UnitTest
- {
- [TestClass]
- public class UnitTest1
- {
- Calculation calculation = new Calculation();
- [TestMethod]
- public void GetQuantityForProduct_DateExample()
- {
- int ex = 5;
- int ans = calculation.GetPriorityForAgent(2, 23, (float)1.5);
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct_ExperienceMoreAge()
- {
- int ex = -1;
- int ans = calculation.GetPriorityForAgent(2, 23, 30);
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct_OldSpecialistWithLittleExperience()
- {
- int ex = 3;
- int ans = calculation.GetPriorityForAgent(1, 40, (float)1.5);
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct_YungSpecialist()
- {
- int ex = 3;
- int ans = calculation.GetPriorityForAgent(1, 23, (float)1.5);
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct__NonExistentAgentType()
- {
- int ex = -1;
- int ans = calculation.GetPriorityForAgent(9, 23, (float)1.5);
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct__NonExistentAge()
- {
- int ex = -1;
- int ans = calculation.GetPriorityForAgent(1, -2, (float)1.5);
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct__NonExistentExperience()
- {
- int ex = -1;
- int ans = calculation.GetPriorityForAgent(1, 23, -2);
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct_IsNotNullRezult()
- {
- Assert.IsNotNull(calculation.GetPriorityForAgent(2, 23, (float)1.5));
- }
- [TestMethod]
- public void GetQuantityForProduct_IntRezult()
- {
- Assert.IsInstanceOfType(calculation.GetPriorityForAgent(2, 23, (float)1.5), typeof(int));
- }
- [TestMethod]
- public void GetQuantityForProduct_NullExperience()
- {
- int ex = -1;
- int ans = calculation.GetPriorityForAgent(Convert.ToInt32(null), 23, -2);
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct_NullAge()
- {
- int ex = -1;
- int ans = calculation.GetPriorityForAgent(1, Convert.ToInt32(null), -2);
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct_NullAgentTypet()
- {
- int ex = -1;
- int ans = calculation.GetPriorityForAgent(1, 23, Convert.ToInt32(null));
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct_BigExperience()
- {
- int ex = -1;
- int ans = calculation.GetPriorityForAgent(900000000, 23, -2);
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct_BigAge()
- {
- int ex = -1;
- int ans = calculation.GetPriorityForAgent(1, 9000000000000000000, -2);
- Assert.AreEqual(ex, ans);
- }
- [TestMethod]
- public void GetQuantityForProduct_BiggentTypet()
- {
- int ex = -1;
- int ans = calculation.GetPriorityForAgent(1, 23, 9000000000000000000);
- Assert.AreEqual(ex, ans);
- }
- }
- }
|