UnitTest1.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using ClassLibrary_CountingSale;
  4. namespace UnitTestBooks
  5. {
  6. [TestClass]
  7. public class UnitTest1
  8. {
  9. [TestMethod]
  10. public void TestMethod1()
  11. {
  12. Assert.AreEqual(SaleCount.saleCount(1, 2), 0);
  13. }
  14. [TestMethod]
  15. public void TestMethod2()
  16. {
  17. Assert.AreEqual(SaleCount.saleCount(3, 200), 5);
  18. }
  19. [TestMethod]
  20. public void TestMethod3()
  21. {
  22. Assert.AreEqual(SaleCount.saleCount(3, 500), 6);
  23. }
  24. [TestMethod]
  25. public void TestMethod4()
  26. {
  27. Assert.AreEqual(SaleCount.saleCount(1, 500), 1);
  28. }
  29. [TestMethod]
  30. public void TestMethod5()
  31. {
  32. Assert.AreEqual(SaleCount.saleCount(1, 1000), 2);
  33. }
  34. [TestMethod]
  35. public void TestMethod6()
  36. {
  37. Assert.AreEqual(SaleCount.saleCount(4, 1000), 7);
  38. }
  39. [TestMethod]
  40. public void TestMethod7()
  41. {
  42. Assert.AreEqual(SaleCount.saleCount(9, 0), 5);
  43. }
  44. [TestMethod]
  45. public void TestMethod8()
  46. {
  47. Assert.AreEqual(SaleCount.saleCount(1100, 1000), 7);
  48. }
  49. [TestMethod]
  50. public void TestMethod9()
  51. {
  52. Assert.AreEqual(SaleCount.saleCount(0, 0), 0);
  53. }
  54. [TestMethod]
  55. public void TestMethod10()
  56. {
  57. Assert.AreEqual(SaleCount.saleCount(0, 2000), 4);
  58. }
  59. }
  60. }