Skip to content

Instantly share code, notes, and snippets.

@SunXiaoShan
Created November 4, 2019 04:09
Show Gist options
  • Save SunXiaoShan/b1c48524e9ec9c79130bea2dbefe61ea to your computer and use it in GitHub Desktop.
Save SunXiaoShan/b1c48524e9ec9c79130bea2dbefe61ea to your computer and use it in GitHub Desktop.
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