Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Adapt the test to use the IEnumerable implementation of Selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Weber committed Dec 28, 2015
1 parent 3772b6a commit 5d77bcf
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions test/Pather.CSharp.UnitTests/ResolverTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,12 @@ public void MultipleArrayIndexResolution_CorrectSetup_Success()
public void SelectionResolution_CorrectSetup_Success()
{
var r = new Resolver();
var array = new[]
{
new { P1 = "1" },
new { P1 = "2" }
};
var array = new[] { 1, 2};
var path = "[]";

var result = r.Resolve(array, path);
result.Should().BeOfType(typeof(Selection));
result.ShouldBeEquivalentTo(new[] { 1, 2 });
}

[Fact]
Expand All @@ -134,9 +131,9 @@ public void SelectionPropertyResolution_CorrectSetup_Success()
};
var path = "[].P1";

var result = r.Resolve(array, path) as Selection;
var result = r.Resolve(array, path) as IEnumerable;
result.Should().NotBeNull();
result.Entries.Should().BeEquivalentTo(new[] { "1", "2" });
result.Should().BeEquivalentTo(new[] { "1", "2" });
}

[Fact]
Expand All @@ -150,9 +147,9 @@ public void SelectionDictionaryKeyResolution_CorrectSetup_Success()
};
var path = "[][Key]";

var result = r.Resolve(array, path) as Selection;
var result = r.Resolve(array, path) as IEnumerable;
result.Should().NotBeNull();
result.Entries.Should().BeEquivalentTo(new[] { "1", "2" });
result.Should().BeEquivalentTo(new[] { "1", "2" });
}

[Fact]
Expand All @@ -166,9 +163,9 @@ public void SelectionArrayIndexResolution_CorrectSetup_Success()
};
var path = "[][1]";

var result = r.Resolve(array, path) as Selection;
var result = r.Resolve(array, path) as IEnumerable;
result.Should().NotBeNull();
result.Entries.Should().BeEquivalentTo(new[] { "2", "4" });
result.Should().BeEquivalentTo(new[] { "2", "4" });
}

[Fact]
Expand All @@ -182,9 +179,9 @@ public void SelectionFlattening_CorrectSetup_Success()
};
var path = "[][]";

var result = r.Resolve(array, path) as Selection;
var result = r.Resolve(array, path) as IEnumerable;
result.Should().NotBeNull();
result.Entries.Should().BeEquivalentTo(new[] { 1, 2, 3 });
result.Should().BeEquivalentTo(new[] { 1, 2, 3 });
}

[Fact]
Expand Down

0 comments on commit 5d77bcf

Please sign in to comment.