Repeat with a chained statement does not seem to be working properly. A test with this recorded fails on the second access:
using(RecordExpectations recorder = RecorderManager.StartRecording()){
recorder.ExpectAndReturn(promoCode.Promotion.IsActive, true).Repeat(2);
}
but yet this works
using(RecordExpectations recorder = RecorderManager.StartRecording()){
recorder.ExpectAndReturn(promoCode.Promotion.IsActive, true);
recorder.ExpectAndReturn(promoCode.Promotion.IsActive, true);
}
this is the error that the first code block generates when the 2nd expectation is hit
TestCase 'GameFly.Retail.UnitTests.Domain.Marketing.RentalPromoCodeFixture.MaxedOutIfToManyRedeemed'
failed: System.NullReferenceException: Object reference not set to an instance of an object.
at TypeMock.MethodDecorator.b()
at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Object[] A_5)
at TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected)
C:DataProjectsGameFlyRetailMainLineSrcGameFly.Retail.UnitTestsDomainMarketingRentalPromoCodeFixture.cs(52,0): at GameFly.Retail.UnitTests.Domain.Marketing.RentalPromoCodeFixture.MaxedOutIfToManyRedeemed()
Let me know if I can provide any more info.