1- using Xunit ;
1+ using Xunit ;
22
33public class FoodChainTest
44{
55 [ Fact ]
6- public void Verse_one ( )
6+ public void Fly ( )
77 {
8- const string expected = "I know an old lady who swallowed a fly. \n " +
9- "I don't know why she swallowed the fly. Perhaps she'll die." ;
10-
8+ var expected =
9+ "I know an old lady who swallowed a fly.\n " +
10+ "I don't know why she swallowed the fly. Perhaps she'll die." ;
1111 Assert . Equal ( expected , FoodChain . Verse ( 1 ) ) ;
1212 }
1313
1414 [ Fact ( Skip = "Remove to run test" ) ]
15- public void Verse_two ( )
15+ public void Spider ( )
1616 {
17- const string expected = "I know an old lady who swallowed a spider. \n " +
18- "It wriggled and jiggled and tickled inside her .\n " +
19- "She swallowed the spider to catch the fly .\n " +
20- "I don't know why she swallowed the fly. Perhaps she'll die." ;
21-
17+ var expected =
18+ "I know an old lady who swallowed a spider .\n "+
19+ "It wriggled and jiggled and tickled inside her .\n "+
20+ "She swallowed the spider to catch the fly.\n " +
21+ "I don't know why she swallowed the fly. Perhaps she'll die." ;
2222 Assert . Equal ( expected , FoodChain . Verse ( 2 ) ) ;
2323 }
2424
2525 [ Fact ( Skip = "Remove to run test" ) ]
26- public void Verse_four ( )
26+ public void Bird ( )
2727 {
28- const string expected = "I know an old lady who swallowed a cat.\n " +
29- "Imagine that, to swallow a cat!\n " +
30- "She swallowed the cat to catch the bird.\n " +
31- "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
32- "She swallowed the spider to catch the fly.\n " +
33- "I don't know why she swallowed the fly. Perhaps she'll die." ;
28+ var expected =
29+ "I know an old lady who swallowed a bird.\n " +
30+ "How absurd to swallow a bird!\n " +
31+ "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
32+ "She swallowed the spider to catch the fly.\n " +
33+ "I don't know why she swallowed the fly. Perhaps she'll die." ;
34+ Assert . Equal ( expected , FoodChain . Verse ( 3 ) ) ;
35+ }
3436
37+ [ Fact ( Skip = "Remove to run test" ) ]
38+ public void Cat ( )
39+ {
40+ var expected =
41+ "I know an old lady who swallowed a cat.\n " +
42+ "Imagine that, to swallow a cat!\n " +
43+ "She swallowed the cat to catch the bird.\n " +
44+ "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
45+ "She swallowed the spider to catch the fly.\n " +
46+ "I don't know why she swallowed the fly. Perhaps she'll die." ;
3547 Assert . Equal ( expected , FoodChain . Verse ( 4 ) ) ;
3648 }
3749
3850 [ Fact ( Skip = "Remove to run test" ) ]
39- public void Verse_eight ( )
51+ public void Dog ( )
4052 {
41- const string expected = "I know an old lady who swallowed a horse.\n " +
42- "She's dead, of course!" ;
53+ var expected =
54+ "I know an old lady who swallowed a dog.\n " +
55+ "What a hog, to swallow a dog!\n " +
56+ "She swallowed the dog to catch the cat.\n " +
57+ "She swallowed the cat to catch the bird.\n " +
58+ "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
59+ "She swallowed the spider to catch the fly.\n " +
60+ "I don't know why she swallowed the fly. Perhaps she'll die." ;
61+ Assert . Equal ( expected , FoodChain . Verse ( 5 ) ) ;
62+ }
63+
64+ [ Fact ( Skip = "Remove to run test" ) ]
65+ public void Goat ( )
66+ {
67+ var expected =
68+ "I know an old lady who swallowed a goat.\n " +
69+ "Just opened her throat and swallowed a goat!\n " +
70+ "She swallowed the goat to catch the dog.\n " +
71+ "She swallowed the dog to catch the cat.\n " +
72+ "She swallowed the cat to catch the bird.\n " +
73+ "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
74+ "She swallowed the spider to catch the fly.\n " +
75+ "I don't know why she swallowed the fly. Perhaps she'll die." ;
76+ Assert . Equal ( expected , FoodChain . Verse ( 6 ) ) ;
77+ }
4378
79+ [ Fact ( Skip = "Remove to run test" ) ]
80+ public void Cow ( )
81+ {
82+ var expected =
83+ "I know an old lady who swallowed a cow.\n " +
84+ "I don't know how she swallowed a cow!\n " +
85+ "She swallowed the cow to catch the goat.\n " +
86+ "She swallowed the goat to catch the dog.\n " +
87+ "She swallowed the dog to catch the cat.\n " +
88+ "She swallowed the cat to catch the bird.\n " +
89+ "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
90+ "She swallowed the spider to catch the fly.\n " +
91+ "I don't know why she swallowed the fly. Perhaps she'll die." ;
92+ Assert . Equal ( expected , FoodChain . Verse ( 7 ) ) ;
93+ }
94+
95+ [ Fact ( Skip = "Remove to run test" ) ]
96+ public void Horse ( )
97+ {
98+ var expected =
99+ "I know an old lady who swallowed a horse.\n " +
100+ "She's dead, of course!" ;
44101 Assert . Equal ( expected , FoodChain . Verse ( 8 ) ) ;
45102 }
46103
47104 [ Fact ( Skip = "Remove to run test" ) ]
48- public void Complete_song ( )
105+ public void Multiple_verses ( )
49106 {
50- const string expected = "I know an old lady who swallowed a fly.\n " +
51- "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
52- "\n " +
53- "I know an old lady who swallowed a spider.\n " +
54- "It wriggled and jiggled and tickled inside her.\n " +
55- "She swallowed the spider to catch the fly.\n " +
56- "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
57- "\n " +
58- "I know an old lady who swallowed a bird.\n " +
59- "How absurd to swallow a bird!\n " +
60- "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
61- "She swallowed the spider to catch the fly.\n " +
62- "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
63- "\n " +
64- "I know an old lady who swallowed a cat.\n " +
65- "Imagine that, to swallow a cat!\n " +
66- "She swallowed the cat to catch the bird.\n " +
67- "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
68- "She swallowed the spider to catch the fly.\n " +
69- "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
70- "\n " +
71- "I know an old lady who swallowed a dog.\n " +
72- "What a hog, to swallow a dog!\n " +
73- "She swallowed the dog to catch the cat.\n " +
74- "She swallowed the cat to catch the bird.\n " +
75- "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
76- "She swallowed the spider to catch the fly.\n " +
77- "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
78- "\n " +
79- "I know an old lady who swallowed a goat.\n " +
80- "Just opened her throat and swallowed a goat!\n " +
81- "She swallowed the goat to catch the dog.\n " +
82- "She swallowed the dog to catch the cat.\n " +
83- "She swallowed the cat to catch the bird.\n " +
84- "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
85- "She swallowed the spider to catch the fly.\n " +
86- "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
87- "\n " +
88- "I know an old lady who swallowed a cow.\n " +
89- "I don't know how she swallowed a cow!\n " +
90- "She swallowed the cow to catch the goat.\n " +
91- "She swallowed the goat to catch the dog.\n " +
92- "She swallowed the dog to catch the cat.\n " +
93- "She swallowed the cat to catch the bird.\n " +
94- "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
95- "She swallowed the spider to catch the fly.\n " +
96- "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
97- "\n " +
98- "I know an old lady who swallowed a horse.\n " +
99- "She's dead, of course!" ;
107+ var expected =
108+ "I know an old lady who swallowed a fly.\n " +
109+ "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
110+ "\n " +
111+ "I know an old lady who swallowed a spider.\n " +
112+ "It wriggled and jiggled and tickled inside her.\n " +
113+ "She swallowed the spider to catch the fly.\n " +
114+ "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
115+ "\n " +
116+ "I know an old lady who swallowed a bird.\n " +
117+ "How absurd to swallow a bird!\n " +
118+ "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
119+ "She swallowed the spider to catch the fly.\n " +
120+ "I don't know why she swallowed the fly. Perhaps she'll die." ;
121+ Assert . Equal ( expected , FoodChain . Verse ( 1 , 3 ) ) ;
122+ }
100123
101- Assert . Equal ( expected , FoodChain . Song ( ) ) ;
124+ [ Fact ( Skip = "Remove to run test" ) ]
125+ public void Full_song ( )
126+ {
127+ var expected =
128+ "I know an old lady who swallowed a fly.\n " +
129+ "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
130+ "\n " +
131+ "I know an old lady who swallowed a spider.\n " +
132+ "It wriggled and jiggled and tickled inside her.\n " +
133+ "She swallowed the spider to catch the fly.\n " +
134+ "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
135+ "\n " +
136+ "I know an old lady who swallowed a bird.\n " +
137+ "How absurd to swallow a bird!\n " +
138+ "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
139+ "She swallowed the spider to catch the fly.\n " +
140+ "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
141+ "\n " +
142+ "I know an old lady who swallowed a cat.\n " +
143+ "Imagine that, to swallow a cat!\n " +
144+ "She swallowed the cat to catch the bird.\n " +
145+ "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
146+ "She swallowed the spider to catch the fly.\n " +
147+ "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
148+ "\n " +
149+ "I know an old lady who swallowed a dog.\n " +
150+ "What a hog, to swallow a dog!\n " +
151+ "She swallowed the dog to catch the cat.\n " +
152+ "She swallowed the cat to catch the bird.\n " +
153+ "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
154+ "She swallowed the spider to catch the fly.\n " +
155+ "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
156+ "\n " +
157+ "I know an old lady who swallowed a goat.\n " +
158+ "Just opened her throat and swallowed a goat!\n " +
159+ "She swallowed the goat to catch the dog.\n " +
160+ "She swallowed the dog to catch the cat.\n " +
161+ "She swallowed the cat to catch the bird.\n " +
162+ "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
163+ "She swallowed the spider to catch the fly.\n " +
164+ "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
165+ "\n " +
166+ "I know an old lady who swallowed a cow.\n " +
167+ "I don't know how she swallowed a cow!\n " +
168+ "She swallowed the cow to catch the goat.\n " +
169+ "She swallowed the goat to catch the dog.\n " +
170+ "She swallowed the dog to catch the cat.\n " +
171+ "She swallowed the cat to catch the bird.\n " +
172+ "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n " +
173+ "She swallowed the spider to catch the fly.\n " +
174+ "I don't know why she swallowed the fly. Perhaps she'll die.\n " +
175+ "\n " +
176+ "I know an old lady who swallowed a horse.\n " +
177+ "She's dead, of course!" ;
178+ Assert . Equal ( expected , FoodChain . Verse ( 1 , 8 ) ) ;
102179 }
103180}
0 commit comments