UnitTest1.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using TerminalKFC;
  4. namespace UnitTest
  5. {
  6. [TestClass]
  7. public class UnitTest1
  8. {
  9. [TestMethod]
  10. public void GetNewSum_200and80_280expected()
  11. {
  12. int a = 200;
  13. int b = 80;
  14. int expected = 280;
  15. TerminalKFC.Windows.OrderWindow ow = new TerminalKFC.Windows.OrderWindow();
  16. int actual = ow.GetNewSum(a,b);
  17. Assert.AreEqual(expected, actual);
  18. }
  19. [TestMethod]
  20. public void GetNewSum_0and5000_5000expected()
  21. {
  22. int a = 0;
  23. int b = 5000;
  24. int expected = 5000;
  25. TerminalKFC.Windows.OrderWindow ow = new TerminalKFC.Windows.OrderWindow();
  26. int actual = ow.GetNewSum(a, b);
  27. Assert.AreEqual(expected, actual);
  28. }
  29. [TestMethod]
  30. public void GetNewSum_10and5_15expected()
  31. {
  32. int a = 10;
  33. int b = 5;
  34. int expected = 15;
  35. TerminalKFC.Windows.OrderWindow ow = new TerminalKFC.Windows.OrderWindow();
  36. int actual = ow.GetNewSum(a, b);
  37. Assert.AreEqual(expected, actual);
  38. }
  39. }
  40. }