UnitTest1.cs 772 B

1234567891011121314151617181920212223242526272829303132333435
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using ClassLibrary1;
  4. namespace UnitTestProject1
  5. {
  6. [TestClass]
  7. public class UnitTest1
  8. {
  9. [TestMethod]
  10. public void TestMethod1()
  11. {
  12. int a = 5; int b = 6;
  13. int exp = 11;
  14. int c = a + b;
  15. Assert.AreEqual(exp, c);
  16. }
  17. [TestMethod]
  18. public void TestMethod2()
  19. {
  20. int exp = 7;
  21. int a = 3; int b = 4;
  22. int c = a + b;
  23. Assert.AreEqual(exp, c);
  24. }
  25. [TestMethod]
  26. public void TestMethod3()
  27. {
  28. int exp = 3;
  29. int a = 1; int b = 2;
  30. int c = a + b;
  31. Assert.AreEqual(exp, c);
  32. }
  33. }
  34. }