Created
November 4, 2019 04:09
-
-
Save SunXiaoShan/b1c48524e9ec9c79130bea2dbefe61ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Calculator | |
{ | |
public int Add(int x, int y) | |
{ | |
return x + y; | |
} | |
} | |
[TestClass] | |
public class UnitTest1 | |
{ | |
[TestMethod] | |
public void UnitTest3ARule() | |
{ | |
//Arrange | |
var calc = new Calculator(); | |
int x = 10, y = 20; | |
//Act | |
int actual = calc.Add(x, y); | |
//Assert | |
int expected = 30; | |
Assert.AreEqual(expected, actual); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment