Hello, I grabbed this example from docs and added virtual modifier to ReturnFive function because free version can't mock not virtual members.
As far as I understand this modification shouldn't influence test results, though this test fails with "Expected: 7 But was: 5"
I can't find any explicit statement in docs about future mock feature support in free version, so I'm not sure if it's my fault or this feature is just not available.
Any help would be appreciated.
public class UserData
{
public virtual int ReturnFive()
{
return 5;
}
}
[Test]
public void ShouldArrangeReturnForFutureUserDataInstances()
{
// Arrange
var fakeUsed = Mock.Create<UserData>();
Mock.Arrange(() => fakeUsed.ReturnFive()).IgnoreInstance().Returns(7);
// Assert
Assert.AreEqual(7, fakeUsed.ReturnFive());
Assert.AreEqual(7, new UserData().ReturnFive());
}
As far as I understand this modification shouldn't influence test results, though this test fails with "Expected: 7 But was: 5"
I can't find any explicit statement in docs about future mock feature support in free version, so I'm not sure if it's my fault or this feature is just not available.
Any help would be appreciated.
public class UserData
{
public virtual int ReturnFive()
{
return 5;
}
}
[Test]
public void ShouldArrangeReturnForFutureUserDataInstances()
{
// Arrange
var fakeUsed = Mock.Create<UserData>();
Mock.Arrange(() => fakeUsed.ReturnFive()).IgnoreInstance().Returns(7);
// Assert
Assert.AreEqual(7, fakeUsed.ReturnFive());
Assert.AreEqual(7, new UserData().ReturnFive());
}