Skip to content

Commit

Permalink
Cross-platform compatibility (#957)
Browse files Browse the repository at this point in the history
* Make test newline-style agnostic

* Ignore NU1701 for Chill on .NetCore2.0
  • Loading branch information
jnyrup committed Nov 5, 2018
1 parent 7738a65 commit d3c1e23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Tests/NetCore20.Specs/NetCore20.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<LangVersion>7.2</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Chill" Version="3.2.0" />
<PackageReference Include="Chill" Version="3.2.0">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="FakeItEasy" Version="4.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
Expand Down
5 changes: 2 additions & 3 deletions Tests/Shared.Specs/BasicEquivalencySpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2789,13 +2789,12 @@ public void When_not_all_the_properties_of_the_nested_objects_are_equal_it_shoul
//-----------------------------------------------------------------------------------------------------------
// Assert
//-----------------------------------------------------------------------------------------------------------
act
.Should().Throw<XunitException>().Which.Message
act.Should().Throw<XunitException>().Which.Message
// Checking exception message exactly is against general guidelines
// but in that case it was done on purpose, so that we have at least single
// test confirming that whole mechanism of gathering description from
// equivalency steps works.
.Should().Be("Expected member Level.Text to be \"Level2\", but \"Level1\" differs near \"1\" (index 5).\r\n\nWith configuration:\n- Use declared types and members\r\n- Compare enums by value\r\n- Match member by name (or throw)\r\n- Without automatic conversion.\r\n- Be strict about the order of items in byte arrays\r\n");
.Should().MatchRegex(@"^Expected member Level\.Text to be ""Level2"", but ""Level1"" differs near ""1"" \(index 5\)\.[\r\n]+With configuration:[\r\n]+\- Use declared types and members[\r\n]+\- Compare enums by value[\r\n]+\- Match member by name \(or throw\)[\r\n]+\- Without automatic conversion\.[\r\n]+\- Be strict about the order of items in byte arrays[\r\n]+$");
}

[Fact]
Expand Down

0 comments on commit d3c1e23

Please sign in to comment.