public void IsSpecialistDesignatedCollegeMeetsExpectation(int ukprn, bool expectation) { // arrange var mockItem = new Mock <ILearningDelivery>(); var handler = new Mock <IValidationErrorHandler>(MockBehavior.Strict); var service = new Mock <ILARSDataService>(MockBehavior.Strict); var commonChecks = new Mock <IProvideRuleCommonOperations>(MockBehavior.Strict); var fileData = new Mock <IFileDataService>(MockBehavior.Strict); fileData .Setup(x => x.UKPRN()) .Returns(ukprn); var orgData = new Mock <IOrganisationDataService>(MockBehavior.Strict); orgData .Setup(x => x.LegalOrgTypeMatchForUkprn(ukprn, "USDC")) .Returns(expectation); var sut = new LearnAimRef_78Rule(handler.Object, service.Object, commonChecks.Object, fileData.Object, orgData.Object); // act var result = sut.IsSpecialistDesignatedCollege(); // assert handler.VerifyAll(); service.VerifyAll(); commonChecks.VerifyAll(); fileData.VerifyAll(); orgData.VerifyAll(); Assert.Equal(expectation, result); }
public void IsSpecialistDesignatedCollegeMeetsExpectation(int ukprn, bool expectation) { var mockItem = new Mock <ILearningDelivery>(); var handler = new Mock <IValidationErrorHandler>(MockBehavior.Strict); var service = new Mock <ILARSDataService>(MockBehavior.Strict); var learningDeliveryFAMQS = new Mock <ILearningDeliveryFAMQueryService>(MockBehavior.Strict); var fileData = new Mock <IFileDataService>(MockBehavior.Strict); fileData .Setup(x => x.UKPRN()) .Returns(ukprn); var orgData = new Mock <IOrganisationDataService>(MockBehavior.Strict); orgData .Setup(x => x.LegalOrgTypeMatchForUkprn(ukprn, "USDC")) .Returns(expectation); var dd07 = new Mock <IDerivedData_07Rule>(MockBehavior.Strict); var dateTimeQS = new Mock <IDateTimeQueryService>(MockBehavior.Strict); var sut = new LearnAimRef_78Rule(handler.Object, service.Object, learningDeliveryFAMQS.Object, fileData.Object, orgData.Object, dd07.Object, dateTimeQS.Object); var result = sut.IsSpecialistDesignatedCollege(); handler.VerifyAll(); service.VerifyAll(); learningDeliveryFAMQS.VerifyAll(); fileData.VerifyAll(); orgData.VerifyAll(); dd07.VerifyAll(); Assert.Equal(expectation, result); }