Skip to content

Commit

Permalink
Merge pull request #332 from JakeGinnivan/ShouldContainWithoutWhitesp…
Browse files Browse the repository at this point in the history
…aceBugFix

Fixed #330
  • Loading branch information
JakeGinnivan committed Nov 21, 2015
2 parents fd60530 + 2888b48 commit 2e9ae29
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Shouldly.Tests/Shouldly.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
<Compile Include="ShouldThrow\NestedAwaitsDoNotDeadlockScenario.cs" />
<Compile Include="ShouldThrow\TaskWithTimeoutScenario.cs" />
<Compile Include="Strings\ShouldBeNullOrWhiteSpace.cs" />
<Compile Include="Strings\ShouldContainWithoutWhitespaceSubset.cs" />
<Compile Include="Strings\ShouldEndWith\BasicScenarioCaseInSensitive.cs" />
<Compile Include="Strings\ShouldEndWith\BasicScenarioCaseSensitive.cs" />
<Compile Include="Strings\ShouldNotEndWith\ShouldIgnoreCaseByDefault.cs" />
Expand Down
13 changes: 13 additions & 0 deletions src/Shouldly.Tests/Strings/ShouldContainWithoutWhitespaceSubset.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using NUnit.Framework;

namespace Shouldly.Tests.Strings
{
public class ShouldContainWithoutWhitespaceSubset
{
[Test]
public void CanMatchOnSubset()
{
"Fun with space and some extra stuff".ShouldContainWithoutWhitespace("Fun with space");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static void ShouldContainWithoutWhitespace(this string actual, object exp
var strippedActual = actual.Quotify().StripWhitespace();
var strippedExpected = (expected ?? "NULL").ToString().Quotify().StripWhitespace();

strippedActual.AssertAwesomely(v => Is.Equal(v, strippedExpected), actual, expected, customMessage);
strippedActual.AssertAwesomely(v => v.Contains(strippedExpected), actual, expected, customMessage);
}

public static void ShouldContain(this string actual, string expected)
Expand Down

0 comments on commit 2e9ae29

Please sign in to comment.