Skip to content

Commit

Permalink
Build: improve coverage for StringAnalyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
dupdob committed Jun 13, 2017
1 parent bf83672 commit b726cb6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ public void ShouldReportDifferenceInSpaces()
Check.That(stringDifference[0].Kind).IsEqualTo(DifferenceMode.Spaces); Check.That(stringDifference[0].Kind).IsEqualTo(DifferenceMode.Spaces);
} }


[Test]
public void ShouldReportDifferenceInSpacesAtEnd()
{
var stringDifference = StringDifference.Analyze("toto ", "toto\t ", false);
Check.That(stringDifference).HasSize(1);
Check.That(stringDifference[0].Kind).IsEqualTo(DifferenceMode.Spaces);
}

[Test] [Test]
public void ShouldReportDifferenceOfEoL() public void ShouldReportDifferenceOfEoL()
{ {
Expand Down
7 changes: 4 additions & 3 deletions tests/NFluent.Tests/UserReportedIssuesTests.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ public class UserReportedIssuesTests
// issue 187 // issue 187
private class FakeClass private class FakeClass
{ {
// ReSharper disable once UnusedAutoPropertyAccessor.Local
public List<string> Items { get; set; } public List<string> Items { get; set; }
} }


[Test] [Test]
public void hasfieldswithsamevalue_should_process_null_fields() public void HasFieldsWithSameValueShouldProcessNullFields()
{ {
var instance1 = new FakeClass() var instance1 = new FakeClass()
{ {
Expand Down Expand Up @@ -352,8 +353,8 @@ public void SpuriousExceptionOnError()
Check.ThatCode(() => Check.ThatCode(() =>
{ {
var toTest = new List<string> { "MaChaine{94}" }; var toTest = new List<string> { "MaChaine{94}" };
const string result = "MaChaine{964}"; const string Result = "MaChaine{964}";
Check.That(toTest).Contains(result); Check.That(toTest).Contains(Result);
}) })
.Throws<FluentCheckException>() .Throws<FluentCheckException>()
.WithMessage(Environment.NewLine+ "The checked enumerable does not contain the expected value(s):" + Environment.NewLine + "\t[\"MaChaine{964}\"]" + Environment.NewLine + "The checked enumerable:" + Environment.NewLine + "\t[\"MaChaine{94}\"]" + Environment.NewLine + "The expected value(s):" + Environment.NewLine + "\t[\"MaChaine{964}\"]"); .WithMessage(Environment.NewLine+ "The checked enumerable does not contain the expected value(s):" + Environment.NewLine + "\t[\"MaChaine{964}\"]" + Environment.NewLine + "The checked enumerable:" + Environment.NewLine + "\t[\"MaChaine{94}\"]" + Environment.NewLine + "The expected value(s):" + Environment.NewLine + "\t[\"MaChaine{964}\"]");
Expand Down

0 comments on commit b726cb6

Please sign in to comment.