Skip to content

Commit

Permalink
Fix semantic error in MatchersFixture.cs test
Browse files Browse the repository at this point in the history
The second parameter of `Enumberable.Range` should be the count, not the end number
  • Loading branch information
go-hoon authored and kzu committed Aug 8, 2024
1 parent e4634eb commit 0fea50e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Moq.Tests/MatchersFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void MatchesIsInEnumerable()
var mock = new Mock<IFoo>();

mock.Setup(x => x.Echo(It.IsIn(Enumerable.Range(1, 5)))).Returns(1);
mock.Setup(x => x.Echo(It.IsIn(Enumerable.Range(6, 10)))).Returns(2);
mock.Setup(x => x.Echo(It.IsIn(Enumerable.Range(6, 5)))).Returns(2);

Assert.Equal(1, mock.Object.Echo(1));
Assert.Equal(1, mock.Object.Echo(2));
Expand Down Expand Up @@ -121,7 +121,7 @@ public void MatchesIsNotInEnumerable()
var mock = new Mock<IFoo>();

mock.Setup(x => x.Echo(It.IsNotIn(Enumerable.Range(1, 5)))).Returns(1);
mock.Setup(x => x.Echo(It.IsNotIn(Enumerable.Range(6, 10)))).Returns(2);
mock.Setup(x => x.Echo(It.IsNotIn(Enumerable.Range(6, 5)))).Returns(2);

Assert.Equal(2, mock.Object.Echo(1));
Assert.Equal(2, mock.Object.Echo(2));
Expand Down

0 comments on commit 0fea50e

Please sign in to comment.