TestDLL.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using MathSale;
  2. using Microsoft.VisualStudio.TestTools.UnitTesting;
  3. namespace TestDll
  4. {
  5. [TestClass]
  6. public class TestDLL
  7. {
  8. Sale sale = new Sale();
  9. [TestMethod]
  10. public void TestDll_1()
  11. {
  12. decimal exp = (decimal)16.15;
  13. var ans = sale.sale(10, 575);
  14. Assert.AreEqual(exp, ans);
  15. }
  16. [TestMethod]
  17. public void TestDll_2()
  18. {
  19. decimal exp = (decimal)8726.11;
  20. var ans = sale.sale(345, 4355555);
  21. Assert.AreEqual(exp, ans);
  22. }
  23. [TestMethod]
  24. public void TestDll_3()
  25. {
  26. decimal exp = (decimal)15.71;
  27. var ans = sale.sale(15, 355);
  28. Assert.AreEqual(exp, ans);
  29. }
  30. [TestMethod]
  31. public void TestDll_4()
  32. {
  33. decimal exp = (decimal)215;
  34. var ans = sale.sale(12, 100000);
  35. Assert.AreEqual(exp, ans);
  36. }
  37. [TestMethod]
  38. public void TestDll_5()
  39. {
  40. decimal exp = (decimal)19;
  41. var ans = sale.sale(124, 2000);
  42. Assert.AreEqual(exp, ans);
  43. }
  44. [TestMethod]
  45. public void TestDll_6()
  46. {
  47. decimal exp = (decimal)10.6;
  48. var ans = sale.sale(5, 300);
  49. Assert.AreEqual(exp, ans);
  50. }
  51. [TestMethod]
  52. public void TestDll_7()
  53. {
  54. decimal exp = (decimal)11.2;
  55. var ans = sale.sale(7, 600);
  56. Assert.AreEqual(exp, ans);
  57. }
  58. [TestMethod]
  59. public void TestDll_8()
  60. {
  61. decimal exp = (decimal)0;
  62. var ans = sale.sale(2, 400);
  63. Assert.AreEqual(exp, ans);
  64. }
  65. [TestMethod]
  66. public void TestDll_9()
  67. {
  68. decimal exp = (decimal)15.426;
  69. var ans = sale.sale(123, 213);
  70. Assert.AreEqual(exp, ans);
  71. }
  72. [TestMethod]
  73. public void TestDll_10()
  74. {
  75. decimal exp = (decimal)16.084;
  76. var ans = sale.sale(12, 542);
  77. Assert.AreEqual(exp, ans);
  78. }
  79. }
  80. }