Tutorial by Examples

The importance of good naming, can be best illustrated by some bad examples: [Test] Test1() {...} //Cryptic name - absolutely no information [Test] TestFoo() {...} //Name of the function - and where can I find the expected behaviour? [Test] TestTFSid567843() {...} //Huh? You want me to lo...
Same as, with writing classes - start with the simple cases, then add requirement (aka tests) and implementation (aka production code) case by case: [Test] public void EnsureThat_IsLeapYearIfDecimalMultipleOf4() {...} [Test] public void EnsureThat_IsNOTLeapYearIfDecimalMultipleOf100 {...} [Tes...
Testcode has the same quality demands, as production code. MakeSut() improves readability can be easily refactored perfectly supports dependency injection. Here's the concept: [Test] public void TestSomething() { var sut = MakeSut(); string result = sut.Do(); Assert....

Page 1 of 1