public void HasQualifyingFundingMeetsExpectation(int fundModel, bool expectation) { var mockDelivery = new Mock <ILearningDelivery>(); mockDelivery .SetupGet(y => y.FundModel) .Returns(fundModel); var handler = new Mock <IValidationErrorHandler>(MockBehavior.Strict); var dateTimeQS = new Mock <IDateTimeQueryService>(MockBehavior.Strict); var lEmpQS = new Mock <ILearnerEmploymentStatusQueryService>(MockBehavior.Strict); var sut = new EmpStat_07Rule(handler.Object, dateTimeQS.Object, lEmpQS.Object); var result = sut.HasQualifyingFunding(mockDelivery.Object); Assert.Equal(expectation, result); handler.VerifyAll(); dateTimeQS.VerifyAll(); }
public void HasQualifyingFundingMeetsExpectation(bool expectation) { // arrange var mockItem = new Mock <ILearningDelivery>(); var handler = new Mock <IValidationErrorHandler>(MockBehavior.Strict); var commonOps = new Mock <IProvideRuleCommonOperations>(MockBehavior.Strict); commonOps .Setup(x => x.HasQualifyingFunding(mockItem.Object, 25, 82)) .Returns(expectation); var sut = new EmpStat_07Rule(handler.Object, commonOps.Object); // act var result = sut.HasQualifyingFunding(mockItem.Object); // assert Assert.Equal(expectation, result); handler.VerifyAll(); commonOps.VerifyAll(); }