In previous post, I defined a good unit test as one that:tests single unit of workcontains only one assertis self contained Presented sample of code with one unit test, unfortunately had two asserts. Clear violation of the second rule. One of the fellow bloggers MJ pointed out this mistake. It is time to “fix” it and talk about “Only one assert per test” rule.Why only One Assert There are couple of problems with multiple asserts.Unit Test Misinformation Frameworks like NUnit do notify about failing un...
Strona głównaSztuka programowania
Sztuka programowania 4306 dni, 17 godzin, 32 minuty temu 37 pokaż kod licznika zwiń