Commit 19bc2cb
committed
Improve collection assertions
Asserting with Assert.Empty / Assert.NotEmpty gives much better error messages when the assertion fails.
Before:
```
Assert.True() Failure
Expected: True
Actual: False
at XmlSchemaClassGenerator.Tests.Compiler.Compile(String name, String[] contents) in XmlSchemaClassGenerator/XmlSchemaClassGenerator.Tests/Compiler.cs:line 152
```
After:
```
Assert.Empty() Failure
Collection: [(11144,6): error CS0579: Duplicate 'System.CodeDom.Compiler.GeneratedCodeAttribute' attribute, (11145,6): error CS0579: Duplicate 'System.SerializableAttribute' attribute, (11147,6): error CS0579: Duplicate 'System.Xml.Serialization.XmlRootAttribute' attribute, (10023,26): error CS0146: Circular base class dependency involving 'User' and 'User']
at XmlSchemaClassGenerator.Tests.Compiler.Compile(String name, String[] contents) in XmlSchemaClassGenerator/XmlSchemaClassGenerator.Tests/Compiler.cs:line 152
```1 parent 2d290d0 commit 19bc2cb
2 files changed
Lines changed: 8 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
152 | 154 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | 155 | | |
158 | 156 | | |
159 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
0 commit comments