Skip to content

Commit 1866881

Browse files
authored
Merge pull request #1052 from shouldly/house-keeping
Housekeeping changes
2 parents 4d92bf9 + 9d6b9c5 commit 1866881

137 files changed

Lines changed: 6374 additions & 4715 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Shouldly.Tests/Dictionaries/ShouldContainKey.cs

Lines changed: 153 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,26 @@ public void ClassScenarioShouldFailForDictionary()
1111
ClassDictionary().ShouldContainKey(new(), "Some additional context"),
1212

1313
errorWithSource:
14-
@"ClassDictionary()
15-
should contain key
16-
Shouldly.Tests.TestHelpers.MyThing (000000)
17-
but does not
14+
"""
15+
ClassDictionary()
16+
should contain key
17+
Shouldly.Tests.TestHelpers.MyThing (000000)
18+
but does not
1819
19-
Additional Info:
20-
Some additional context",
20+
Additional Info:
21+
Some additional context
22+
""",
2123

2224
errorWithoutSource:
23-
@"[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
24-
should contain key
25-
Shouldly.Tests.TestHelpers.MyThing (000000)
26-
but does not
27-
28-
Additional Info:
29-
Some additional context");
25+
"""
26+
[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
27+
should contain key
28+
Shouldly.Tests.TestHelpers.MyThing (000000)
29+
but does not
30+
31+
Additional Info:
32+
Some additional context
33+
""");
3034
}
3135

3236
[Fact]
@@ -36,22 +40,26 @@ public void GuidScenarioShouldFailForDictionary()
3640
GuidDictionary().ShouldContainKey(MissingGuidKey, "Some additional context"),
3741

3842
errorWithSource:
39-
@"GuidDictionary()
40-
should contain key
41-
1924e617-2fc2-47ae-ad38-b6f30ec2226b
42-
but does not
43+
"""
44+
GuidDictionary()
45+
should contain key
46+
1924e617-2fc2-47ae-ad38-b6f30ec2226b
47+
but does not
4348
44-
Additional Info:
45-
Some additional context",
49+
Additional Info:
50+
Some additional context
51+
""",
4652

4753
errorWithoutSource:
48-
@"[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
49-
should contain key
50-
1924e617-2fc2-47ae-ad38-b6f30ec2226b
51-
but does not
52-
53-
Additional Info:
54-
Some additional context");
54+
"""
55+
[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
56+
should contain key
57+
1924e617-2fc2-47ae-ad38-b6f30ec2226b
58+
but does not
59+
60+
Additional Info:
61+
Some additional context
62+
""");
5563
}
5664

5765
[Fact]
@@ -61,22 +69,26 @@ public void StringScenarioShouldFailForDictionary()
6169
StringDictionary().ShouldContainKey("bar", "Some additional context"),
6270

6371
errorWithSource:
64-
@"StringDictionary()
65-
should contain key
66-
""bar""
67-
but does not
72+
"""
73+
StringDictionary()
74+
should contain key
75+
"bar"
76+
but does not
6877
69-
Additional Info:
70-
Some additional context",
78+
Additional Info:
79+
Some additional context
80+
""",
7181

7282
errorWithoutSource:
73-
@"[[""Foo"" => ""Bar""]]
74-
should contain key
75-
""bar""
76-
but does not
77-
78-
Additional Info:
79-
Some additional context");
83+
"""
84+
[["Foo" => "Bar"]]
85+
should contain key
86+
"bar"
87+
but does not
88+
89+
Additional Info:
90+
Some additional context
91+
""");
8092
}
8193

8294
[Fact]
@@ -86,22 +98,26 @@ public void ClassScenarioShouldFailForIDictionary()
8698
ClassIDictionary().ShouldContainKey(new(), "Some additional context"),
8799

88100
errorWithSource:
89-
@"ClassIDictionary()
90-
should contain key
91-
Shouldly.Tests.TestHelpers.MyThing (000000)
92-
but does not
101+
"""
102+
ClassIDictionary()
103+
should contain key
104+
Shouldly.Tests.TestHelpers.MyThing (000000)
105+
but does not
93106
94-
Additional Info:
95-
Some additional context",
107+
Additional Info:
108+
Some additional context
109+
""",
96110

97111
errorWithoutSource:
98-
@"[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
99-
should contain key
100-
Shouldly.Tests.TestHelpers.MyThing (000000)
101-
but does not
102-
103-
Additional Info:
104-
Some additional context");
112+
"""
113+
[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
114+
should contain key
115+
Shouldly.Tests.TestHelpers.MyThing (000000)
116+
but does not
117+
118+
Additional Info:
119+
Some additional context
120+
""");
105121
}
106122

107123
[Fact]
@@ -111,22 +127,26 @@ public void GuidScenarioShouldFailForIDictionary()
111127
GuidIDictionary().ShouldContainKey(MissingGuidKey, "Some additional context"),
112128

113129
errorWithSource:
114-
@"GuidIDictionary()
115-
should contain key
116-
1924e617-2fc2-47ae-ad38-b6f30ec2226b
117-
but does not
130+
"""
131+
GuidIDictionary()
132+
should contain key
133+
1924e617-2fc2-47ae-ad38-b6f30ec2226b
134+
but does not
118135
119-
Additional Info:
120-
Some additional context",
136+
Additional Info:
137+
Some additional context
138+
""",
121139

122140
errorWithoutSource:
123-
@"[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
124-
should contain key
125-
1924e617-2fc2-47ae-ad38-b6f30ec2226b
126-
but does not
127-
128-
Additional Info:
129-
Some additional context");
141+
"""
142+
[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
143+
should contain key
144+
1924e617-2fc2-47ae-ad38-b6f30ec2226b
145+
but does not
146+
147+
Additional Info:
148+
Some additional context
149+
""");
130150
}
131151

132152
[Fact]
@@ -136,22 +156,26 @@ public void StringScenarioShouldFailForIDictionary()
136156
StringIDictionary().ShouldContainKey("bar", "Some additional context"),
137157

138158
errorWithSource:
139-
@"StringIDictionary()
140-
should contain key
141-
""bar""
142-
but does not
159+
"""
160+
StringIDictionary()
161+
should contain key
162+
"bar"
163+
but does not
143164
144-
Additional Info:
145-
Some additional context",
165+
Additional Info:
166+
Some additional context
167+
""",
146168

147169
errorWithoutSource:
148-
@"[[""Foo"" => ""Bar""]]
149-
should contain key
150-
""bar""
151-
but does not
152-
153-
Additional Info:
154-
Some additional context");
170+
"""
171+
[["Foo" => "Bar"]]
172+
should contain key
173+
"bar"
174+
but does not
175+
176+
Additional Info:
177+
Some additional context
178+
""");
155179
}
156180

157181
#if NET9_0_OR_GREATER
@@ -162,22 +186,26 @@ public void ClassScenarioShouldFailForIReadOnlyDictionary()
162186
ClassIReadOnlyDictionary().ShouldContainKey(new(), "Some additional context"),
163187

164188
errorWithSource:
165-
@"ClassIReadOnlyDictionary()
166-
should contain key
167-
Shouldly.Tests.TestHelpers.MyThing (000000)
168-
but does not
189+
"""
190+
ClassIReadOnlyDictionary()
191+
should contain key
192+
Shouldly.Tests.TestHelpers.MyThing (000000)
193+
but does not
169194
170-
Additional Info:
171-
Some additional context",
195+
Additional Info:
196+
Some additional context
197+
""",
172198

173199
errorWithoutSource:
174-
@"[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
175-
should contain key
176-
Shouldly.Tests.TestHelpers.MyThing (000000)
177-
but does not
178-
179-
Additional Info:
180-
Some additional context");
200+
"""
201+
[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
202+
should contain key
203+
Shouldly.Tests.TestHelpers.MyThing (000000)
204+
but does not
205+
206+
Additional Info:
207+
Some additional context
208+
""");
181209
}
182210

183211
[Fact]
@@ -187,22 +215,26 @@ public void GuidScenarioShouldFailForIReadOnlyDictionary()
187215
GuidIReadOnlyDictionary().ShouldContainKey(MissingGuidKey, "Some additional context"),
188216

189217
errorWithSource:
190-
@"GuidIReadOnlyDictionary()
191-
should contain key
192-
1924e617-2fc2-47ae-ad38-b6f30ec2226b
193-
but does not
218+
"""
219+
GuidIReadOnlyDictionary()
220+
should contain key
221+
1924e617-2fc2-47ae-ad38-b6f30ec2226b
222+
but does not
194223
195-
Additional Info:
196-
Some additional context",
224+
Additional Info:
225+
Some additional context
226+
""",
197227

198228
errorWithoutSource:
199-
@"[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
200-
should contain key
201-
1924e617-2fc2-47ae-ad38-b6f30ec2226b
202-
but does not
203-
204-
Additional Info:
205-
Some additional context");
229+
"""
230+
[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
231+
should contain key
232+
1924e617-2fc2-47ae-ad38-b6f30ec2226b
233+
but does not
234+
235+
Additional Info:
236+
Some additional context
237+
""");
206238
}
207239

208240
[Fact]
@@ -212,22 +244,26 @@ public void StringScenarioShouldFailForIReadOnlyDictionary()
212244
StringIReadOnlyDictionary().ShouldContainKey("bar", "Some additional context"),
213245

214246
errorWithSource:
215-
@"StringIReadOnlyDictionary()
216-
should contain key
217-
""bar""
218-
but does not
247+
"""
248+
StringIReadOnlyDictionary()
249+
should contain key
250+
"bar"
251+
but does not
219252
220-
Additional Info:
221-
Some additional context",
253+
Additional Info:
254+
Some additional context
255+
""",
222256

223257
errorWithoutSource:
224-
@"[[""Foo"" => ""Bar""]]
225-
should contain key
226-
""bar""
227-
but does not
228-
229-
Additional Info:
230-
Some additional context");
258+
"""
259+
[["Foo" => "Bar"]]
260+
should contain key
261+
"bar"
262+
but does not
263+
264+
Additional Info:
265+
Some additional context
266+
""");
231267
}
232268
#endif
233269

0 commit comments

Comments
 (0)