UnitTest1.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using ClassLibrary2;
  4. namespace UnitTestProject1
  5. {
  6. [TestClass]
  7. public class UnitTest1
  8. {
  9. Class1 class1 = new Class1();
  10. [TestMethod]
  11. public void TestMethod1()
  12. {
  13. int exp = 0;
  14. var ans = class1.sale(1, 600);
  15. Assert.AreEqual(exp, ans);
  16. }
  17. [TestMethod]
  18. public void TestMethod2()
  19. {
  20. int exp = 5;
  21. var ans = class1.sale(3, 400);
  22. Assert.AreEqual(exp, ans);
  23. }
  24. [TestMethod]
  25. public void TestMethod3()
  26. {
  27. int exp = 6;
  28. var ans = class1.sale(3, 600);
  29. Assert.AreEqual(exp, ans);
  30. }
  31. [TestMethod]
  32. public void TestMethod4()
  33. {
  34. int exp = 11;
  35. var ans = class1.sale(5, 600);
  36. Assert.AreEqual(exp, ans);
  37. }
  38. [TestMethod]
  39. public void TestMethod5()
  40. {
  41. int exp = 12;
  42. var ans = class1.sale(6, 1200);
  43. Assert.AreEqual(exp, ans);
  44. }
  45. [TestMethod]
  46. public void TestMethod6()
  47. {
  48. int exp = 10;
  49. var ans = class1.sale(5, 300);
  50. Assert.AreEqual(exp, ans);
  51. }
  52. [TestMethod]
  53. public void TestMethod7()
  54. {
  55. int exp = 16;
  56. var ans = class1.sale(11, 600);
  57. Assert.AreEqual(exp, ans);
  58. }
  59. [TestMethod]
  60. public void TestMethod8()
  61. {
  62. int exp = 17;
  63. var ans = class1.sale(15, 1200);
  64. Assert.AreEqual(exp, ans);
  65. }
  66. [TestMethod]
  67. public void TestMethod9()
  68. {
  69. int exp = 0;
  70. var ans = class1.sale(1, 200);
  71. Assert.AreEqual(exp, ans);
  72. }
  73. [TestMethod]
  74. public void TestMethod10()
  75. {
  76. int exp = 19;
  77. var ans = class1.sale(15, 2000);
  78. Assert.AreEqual(exp, ans);
  79. }
  80. }
  81. }