UnitTest1.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using Microsoft.VisualStudio.TestTools.UnitTesting;
  3. using Clicker;
  4. namespace UnitTestProject
  5. {
  6. [TestClass]
  7. public class UnitTest1
  8. {
  9. [TestMethod]
  10. public void b1_test()
  11. {
  12. var page = new MainWindow();
  13. int exp = 4;
  14. int res = page.b1_test(312, 312);
  15. Assert.AreEqual(exp, res);
  16. }
  17. [TestMethod]
  18. public void b2_test()
  19. {
  20. var page = new MainWindow();
  21. int exp = 16;
  22. int res = page.b2_test(2456, 1228);
  23. Assert.AreEqual(exp, res);
  24. }
  25. [TestMethod]
  26. public void b3_test()
  27. {
  28. var page = new MainWindow();
  29. int exp = 34;
  30. int res = page.b3_test(8244, 2748);
  31. Assert.AreEqual(exp, res);
  32. }
  33. [TestMethod]
  34. public void b4_test()
  35. {
  36. var page = new MainWindow();
  37. int exp = 58;
  38. int res = page.b4_test(34104, 4872);
  39. Assert.AreEqual(exp, res);
  40. }
  41. }
  42. }