UnitTest1.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using TestSession2;
  4. namespace TestProject
  5. {
  6. [TestClass]
  7. public class UnitTest1
  8. {
  9. [TestMethod]
  10. public void GetCorrectValues()
  11. {
  12. Product product = new Product(3-1, 1-1, 15, 45, 20);
  13. Assert.IsTrue(WSUniversalLib.Calculate(product) == 114147);
  14. }
  15. [TestMethod]
  16. public void GetQuantityForProduct_NonExistentProductType()
  17. {
  18. Product product = new Product(3 , 1 - 1, 15, 45, 20);
  19. Assert.IsTrue(WSUniversalLib.Calculate(product) == -1);
  20. }
  21. [TestMethod]
  22. public void GetQuantityForProduct_NonExistenMaterialType()
  23. {
  24. Product product = new Product(3-1, 8, 15, 45, 20);
  25. Assert.IsTrue(WSUniversalLib.Calculate(product) == -1);
  26. }
  27. [TestMethod]
  28. public void GetQuantityForProduct_NonExistenMaterialTypeAndProductType()
  29. {
  30. Product product = new Product(3, 8, 15, 45, 20);
  31. Assert.IsTrue(WSUniversalLib.Calculate(product) == -1);
  32. }
  33. }
  34. }