Skip to content

Commit

Permalink
Merge pull request #335 from JakeGinnivan/xunit-conversion
Browse files Browse the repository at this point in the history
Xunit conversion
  • Loading branch information
JakeGinnivan committed Dec 29, 2015
2 parents 76343b5 + b46ba07 commit 81dff8f
Show file tree
Hide file tree
Showing 384 changed files with 10,281 additions and 7,304 deletions.
112 changes: 112 additions & 0 deletions src/Shouldly.Tests/Dictionaries/ShouldContainKey.cs
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 src/Shouldly.Tests/Dictionaries/ShouldContainKey/ClassScenario.cs

This file was deleted.

37 changes: 0 additions & 37 deletions src/Shouldly.Tests/Dictionaries/ShouldContainKey/GuidScenario.cs

This file was deleted.

32 changes: 0 additions & 32 deletions src/Shouldly.Tests/Dictionaries/ShouldContainKey/StringScenario.cs

This file was deleted.

0 comments on commit 81dff8f

Please sign in to comment.