public void IsExcludedForInflexibleElementOfTrainingAim() { // arrange var mockItem = new Mock <ILearner>(); var handler = new Mock <IValidationErrorHandler>(MockBehavior.Strict); var service = new Mock <ILARSDataService>(MockBehavior.Strict); var mockDDRule07 = new Mock <IDerivedData_07Rule>(); var mockDDRule21 = new Mock <IDerivedData_21Rule>(); var mockDDRule28 = new Mock <IDerivedData_28Rule>(); var mockDDRule29 = new Mock <IDerivedData_29Rule>(); var organisationDataService = new Mock <IOrganisationDataService>(); var fileDataService = new Mock <IFileDataService>(MockBehavior.Strict); mockDDRule29 .Setup(x => x.IsInflexibleElementOfTrainingAim(mockItem.Object)) .Returns(true); var sut = new LearnDelFAMType_60Rule(handler.Object, service.Object, mockDDRule07.Object, mockDDRule21.Object, mockDDRule28.Object, mockDDRule29.Object, organisationDataService.Object, fileDataService.Object); // act var result = sut.IsExcluded(mockItem.Object); // assert Assert.True(result); handler.VerifyAll(); service.VerifyAll(); mockDDRule07.VerifyAll(); mockDDRule21.VerifyAll(); mockDDRule28.VerifyAll(); mockDDRule29.VerifyAll(); }
public void IsExcludedForApprenticeship() { // arrange const int progType = 23; var mockDel = new Mock <ILearningDelivery>(); mockDel .SetupGet(x => x.ProgTypeNullable) .Returns(progType); var deliveries = Collection.Empty <ILearningDelivery>(); deliveries.Add(mockDel.Object); var mockItem = new Mock <ILearner>(); mockItem .SetupGet(x => x.LearningDeliveries) .Returns(deliveries.AsSafeReadOnlyList()); var handler = new Mock <IValidationErrorHandler>(MockBehavior.Strict); var service = new Mock <ILARSDataService>(MockBehavior.Strict); var mockDDRule07 = new Mock <IDerivedData_07Rule>(); var mockDDRule21 = new Mock <IDerivedData_21Rule>(); var mockDDRule28 = new Mock <IDerivedData_28Rule>(); var mockDDRule29 = new Mock <IDerivedData_29Rule>(); var organisationDataService = new Mock <IOrganisationDataService>(); var fileDataService = new Mock <IFileDataService>(MockBehavior.Strict); mockDDRule07 .Setup(x => x.IsApprenticeship(progType)) .Returns(true); var sut = new LearnDelFAMType_60Rule(handler.Object, service.Object, mockDDRule07.Object, mockDDRule21.Object, mockDDRule28.Object, mockDDRule29.Object, organisationDataService.Object, fileDataService.Object); // act var result = sut.IsExcluded(mockItem.Object); // assert Assert.True(result); handler.VerifyAll(); service.VerifyAll(); mockDDRule07.VerifyAll(); mockDDRule21.VerifyAll(); mockDDRule28.VerifyAll(); mockDDRule29.VerifyAll(); }