Last active
June 2, 2017 22:02
-
-
Save gangleri/69bcc7acada44a25a715075e3c62a0e0 to your computer and use it in GitHub Desktop.
Test Driven Development: A developer’s safety net
This file contains 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
[TestMethod] | |
public void TestAddPositiveNumbers() | |
{ | |
Calculator cal = new Calculator(); | |
int result = cal.Add(2, 2); | |
Assert.AreEqual(4, result); | |
} |
This file contains 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 int Add(int first, int second) | |
{ | |
throw new NotImplementedException(); | |
} |
This file contains 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 void TestAddNegativeNumbers() | |
{ | |
Calculator cal = new Calculator(); | |
int result = cal.Add(-2, -2); | |
Assert.AreEqual(-4, result); | |
} |
This file contains 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 int Add(int first, int second) | |
{ | |
return first + second; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment