Code changes over time. How can we, as developers, be sure that as we grow our code base that we do not break code that is already there?
use testing tools, write code that tests our code so that we do not have to test our code ourselves.
// In the code
public static int Sum(int a, int b) {
return a + b;
}
// in testing file
[Fact]
public void SumTestPositive()
{
Assert.Equal(10, Sum(7,3));
}
[Fact]
public void SumTestNegative()
{
Assert.Equal(-10, Sum(-7,-3));
}
ko·an /ˈkōän/ noun
a paradoxical anecdote or riddle, used in Zen Buddhism to demonstrate the inadequacy of logical reasoning and to provoke enlightenment.