-
-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #335 from JakeGinnivan/xunit-conversion
Xunit conversion
- Loading branch information
Showing
384 changed files
with
10,281 additions
and
7,304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Shouldly.Tests.Strings; | ||
using Shouldly.Tests.TestHelpers; | ||
using Xunit; | ||
|
||
namespace Shouldly.Tests.Dictionaries | ||
{ | ||
public class ShouldContainKey | ||
{ | ||
[Fact] | ||
public void ClassScenarioShouldFail() | ||
{ | ||
Verify.ShouldFail(() => | ||
_classDictionary.ShouldContainKey(new MyThing(), "Some additional context"), | ||
|
||
errorWithSource: | ||
@"_classDictionary | ||
should contain key | ||
Shouldly.Tests.TestHelpers.MyThing (000000) | ||
but does not | ||
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"); | ||
} | ||
[Fact] | ||
public void GuidScenarioShouldFail() | ||
{ | ||
Verify.ShouldFail(() => | ||
_guidDictionary.ShouldContainKey(_missingGuid, "Some additional context"), | ||
|
||
errorWithSource: | ||
@"_guidDictionary | ||
should contain key | ||
5250646b-4c46-4b0e-86d8-e1421f2a0ea2 | ||
but does not | ||
Additional Info: | ||
Some additional context", | ||
|
||
errorWithoutSource: | ||
@"[[468a57a7-ca19-4b76-a1e3-3040719392bc => a9db46cc-9d3c-4595-ae1b-8e33de4cc6e5]] | ||
should contain key | ||
5250646b-4c46-4b0e-86d8-e1421f2a0ea2 | ||
but does not | ||
Additional Info: | ||
Some additional context"); | ||
} | ||
|
||
[Fact] | ||
public void StringScenarioShouldFail() | ||
{ | ||
Verify.ShouldFail(() => | ||
_stringDictionary.ShouldContainKey("bar", "Some additional context"), | ||
|
||
errorWithSource: | ||
@"_stringDictionary | ||
should contain key | ||
""bar"" | ||
but does not | ||
Additional Info: | ||
Some additional context", | ||
|
||
errorWithoutSource: | ||
@"[[""Foo"" => """"]] | ||
should contain key | ||
""bar"" | ||
but does not | ||
Additional Info: | ||
Some additional context"); | ||
} | ||
|
||
[Fact] | ||
public void ShouldPass() | ||
{ | ||
_classDictionary.ShouldContainKey(ThingKey); | ||
_guidDictionary.ShouldContainKey(GuidKey); | ||
_stringDictionary.ShouldContainKey("Foo"); | ||
} | ||
|
||
static readonly MyThing ThingKey = new MyThing(); | ||
readonly Dictionary<MyThing, MyThing> _classDictionary = new Dictionary<MyThing, MyThing> | ||
{ | ||
{ThingKey, new MyThing()} | ||
}; | ||
|
||
readonly Dictionary<Guid, Guid> _guidDictionary = new Dictionary<Guid, Guid> | ||
{ | ||
{ GuidKey, new Guid("a9db46cc-9d3c-4595-ae1b-8e33de4cc6e5")} | ||
}; | ||
|
||
static readonly Guid GuidKey = new Guid("468a57a7-ca19-4b76-a1e3-3040719392bc"); | ||
readonly Guid _missingGuid = new Guid("5250646b-4c46-4b0e-86d8-e1421f2a0ea2"); | ||
|
||
readonly Dictionary<string, string> _stringDictionary = new Dictionary<string, string> | ||
{ | ||
{ "Foo", ""} | ||
}; | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
src/Shouldly.Tests/Dictionaries/ShouldContainKey/ClassScenario.cs
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
src/Shouldly.Tests/Dictionaries/ShouldContainKey/GuidScenario.cs
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
src/Shouldly.Tests/Dictionaries/ShouldContainKey/StringScenario.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.