moq
moq copied to clipboard
Semantic error in unit test MatchesIsNotInEnumerable()?
Regarding the class Moq.Tests.MatchersFixture, given that the setups in the unit test method MatchesIsInVariadicParameters() are:
mock.Setup(x => x.Echo(It.IsIn(1, 2, 3, 4, 5))).Returns(1);
mock.Setup(x => x.Echo(It.IsIn(6, 7, 8, 9, 10))).Returns(2);
then the ranges in MatchesIsNotInEnumerable():
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);
were probably meant to be:
mock.Setup(x => x.Echo(It.IsNotIn(Enumerable.Range(1, 5)))).Returns(1);
mock.Setup(x => x.Echo(It.IsNotIn(Enumerable.Range(6, 5)))).Returns(2);
since the signature is Range(int start, int count), not Range(int start, int end).
The same is probably true for MatchesIsInEnumerable() given the ranges in MatchesRanges(), except that the latter is using an exclusive range for the second sequence.
Due to lack of recent activity, this issue has been labeled as 'stale'. It will be closed if no further activity occurs within 30 more days. Any new comment will remove the label.
