Strona głównaSztuka programowania

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...

Tagi: unit-tests
Źródło: www.mfranc.com
Dziel się z innymi:
[EN]Good unit test - One Assert | Passionate Programmer

Sztuka programowania 2515 dni, 10 godzin, 12 minut temu michalfranc 36 pokaż kod licznika zwiń

Wczytywanie artykułów...
DAC2019baner
Sklep z gadzetami

Najaktywniejsi

1
(32 891,59)
2
(32 816,53)
3
(27 178,29)
4
(21 178,88)
5
(20 336,33)
6
(13 018,14)
7
(10 512,28)
8
(9 775,28)
9
(8 388,27)
10
(6 822,96)
11
(6 214,22)
12
(5 393,84)
13
(4 127,41)
14
(4 026,73)
15
(3 863,06)
16
(3 599,54)
17
(3 448,35)
18
(3 318,39)
19
(3 224,66)
20
(3 105,41)