Skip to content

Commit

Permalink
Merge pull request #1052 from shouldly/house-keeping
Browse files Browse the repository at this point in the history
Housekeeping changes
  • Loading branch information
slang25 authored Jan 21, 2025
2 parents 4d92bf9 + 9d6b9c5 commit 1866881
Show file tree
Hide file tree
Showing 137 changed files with 6,374 additions and 4,715 deletions.
270 changes: 153 additions & 117 deletions src/Shouldly.Tests/Dictionaries/ShouldContainKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,26 @@ public void ClassScenarioShouldFailForDictionary()
ClassDictionary().ShouldContainKey(new(), "Some additional context"),

errorWithSource:
@"ClassDictionary()
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
"""
ClassDictionary()
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
Additional Info:
Some additional context",
Additional Info:
Some additional context
""",

errorWithoutSource:
@"[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
Additional Info:
Some additional context");
"""
[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
Additional Info:
Some additional context
""");
}

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

errorWithSource:
@"GuidDictionary()
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
"""
GuidDictionary()
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
Additional Info:
Some additional context",
Additional Info:
Some additional context
""",

errorWithoutSource:
@"[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
Additional Info:
Some additional context");
"""
[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
Additional Info:
Some additional context
""");
}

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

errorWithSource:
@"StringDictionary()
should contain key
""bar""
but does not
"""
StringDictionary()
should contain key
"bar"
but does not
Additional Info:
Some additional context",
Additional Info:
Some additional context
""",

errorWithoutSource:
@"[[""Foo"" => ""Bar""]]
should contain key
""bar""
but does not
Additional Info:
Some additional context");
"""
[["Foo" => "Bar"]]
should contain key
"bar"
but does not
Additional Info:
Some additional context
""");
}

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

errorWithSource:
@"ClassIDictionary()
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
"""
ClassIDictionary()
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
Additional Info:
Some additional context",
Additional Info:
Some additional context
""",

errorWithoutSource:
@"[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
Additional Info:
Some additional context");
"""
[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
Additional Info:
Some additional context
""");
}

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

errorWithSource:
@"GuidIDictionary()
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
"""
GuidIDictionary()
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
Additional Info:
Some additional context",
Additional Info:
Some additional context
""",

errorWithoutSource:
@"[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
Additional Info:
Some additional context");
"""
[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
Additional Info:
Some additional context
""");
}

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

errorWithSource:
@"StringIDictionary()
should contain key
""bar""
but does not
"""
StringIDictionary()
should contain key
"bar"
but does not
Additional Info:
Some additional context",
Additional Info:
Some additional context
""",

errorWithoutSource:
@"[[""Foo"" => ""Bar""]]
should contain key
""bar""
but does not
Additional Info:
Some additional context");
"""
[["Foo" => "Bar"]]
should contain key
"bar"
but does not
Additional Info:
Some additional context
""");
}

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

errorWithSource:
@"ClassIReadOnlyDictionary()
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
"""
ClassIReadOnlyDictionary()
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
Additional Info:
Some additional context",
Additional Info:
Some additional context
""",

errorWithoutSource:
@"[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
Additional Info:
Some additional context");
"""
[[Shouldly.Tests.TestHelpers.MyThing (000000) => Shouldly.Tests.TestHelpers.MyThing (000000)]]
should contain key
Shouldly.Tests.TestHelpers.MyThing (000000)
but does not
Additional Info:
Some additional context
""");
}

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

errorWithSource:
@"GuidIReadOnlyDictionary()
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
"""
GuidIReadOnlyDictionary()
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
Additional Info:
Some additional context",
Additional Info:
Some additional context
""",

errorWithoutSource:
@"[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
Additional Info:
Some additional context");
"""
[[edae0d73-8e4c-4251-85c8-e5497c7ccad1 => fa1e5f58-578f-43d4-b4d6-67eae06a5d17]]
should contain key
1924e617-2fc2-47ae-ad38-b6f30ec2226b
but does not
Additional Info:
Some additional context
""");
}

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

errorWithSource:
@"StringIReadOnlyDictionary()
should contain key
""bar""
but does not
"""
StringIReadOnlyDictionary()
should contain key
"bar"
but does not
Additional Info:
Some additional context",
Additional Info:
Some additional context
""",

errorWithoutSource:
@"[[""Foo"" => ""Bar""]]
should contain key
""bar""
but does not
Additional Info:
Some additional context");
"""
[["Foo" => "Bar"]]
should contain key
"bar"
but does not
Additional Info:
Some additional context
""");
}
#endif

Expand Down
Loading

0 comments on commit 1866881

Please sign in to comment.