UnitTest1.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using System.Text.RegularExpressions;
  4. using WSUniversalLib;
  5. namespace UnitTestWSUniversalLib
  6. {
  7. [TestClass]
  8. public class UnitTest1
  9. {
  10. [TestMethod]
  11. public void TestGetQuantityForProductIsInstanceOfType()
  12. {
  13. Assert.IsInstanceOfType(Calculation.GetQuantityForProduct(3, 1, 15, 20, 45), typeof(int));
  14. }
  15. [TestMethod]
  16. public void TestGetQuantityForProductIsNotInstanceOfTypeString()
  17. {
  18. Assert.IsInstanceOfType(Calculation.GetQuantityForProduct(3, 1, 15, 20, 45), typeof(int));
  19. }
  20. [TestMethod]
  21. public void TestGetQuantityForProductAreEqual()
  22. {
  23. Assert.AreEqual(Calculation.GetQuantityForProduct(3, 1, 15, 20, 45), 114146);
  24. }
  25. [TestMethod]
  26. public void TestGetQuantityForProductAreNotEqual()
  27. {
  28. Assert.AreNotEqual(Calculation.GetQuantityForProduct(3, 1, 15, 20, 45),999999);
  29. }
  30. [TestMethod]
  31. public void TestGetQuantityForProductIsNotNull()
  32. {
  33. Assert.IsNotNull(Calculation.GetQuantityForProduct(3, 1, 15, 20, 45));
  34. }
  35. }
  36. }