[TestFixture]
public class Class1
{
public class Individual
{
}
public class Family : Collection<
Individual
>
{
}
public interface ITest
{
int Test(Family family);
}
[Test]
public void Test()
{
var family1 = new Family();
var family2 = new Family();
var test = Mock.Create<
ITest
>();
Mock.Arrange(() => test.Test(family1)).Returns(1).MustBeCalled();
Mock.Arrange(() => test.Test(family2)).Returns(2).MustBeCalled();
var result = test.Test(family1) + test.Test(family2);
Mock.Assert(test);
}
}
Occurrence expectation failed. Expected at least 1 call. Calls so far: 0
Arrange expression: () => test.Test(family1).
However, when I change the code to not have Family based on Collection<Individual> it works.
This does not seem correct. Is this a bug, or am I missing something on how JustMock is matching these parameters?
Eric Gurney