public void LearnAimRef06PassesIrrelevantDeliveryCode() { var suppData = new SupplementaryDataModel { LearnAimRef = "Foo", DeliverableCode = "Foo" }; var refDataServiceMock = new Mock <IReferenceDataService>(); var rule = new LearnAimRef06(_messageServiceMock.Object, refDataServiceMock.Object); Assert.True(rule.IsValid(suppData)); }
public void LearnAimRef06PassesNoLarsLearningDelivery() { var suppData = new SupplementaryDataModel { LearnAimRef = "Foo", DeliverableCode = "NR01" }; var refDataServiceMock = new Mock <IReferenceDataService>(); refDataServiceMock .Setup(m => m.GetLarsLearningDelivery(suppData.LearnAimRef)) .Returns((LarsLearningDeliveryModel)null); var rule = new LearnAimRef06(_messageServiceMock.Object, refDataServiceMock.Object); Assert.True(rule.IsValid(suppData)); }
public void LearnAimRef06FailsGenreFound(string genre) { var suppData = new SupplementaryDataModel { LearnAimRef = "Foo", DeliverableCode = "NR01" }; var refDataServiceMock = new Mock <IReferenceDataService>(); refDataServiceMock .Setup(m => m.GetLarsLearningDelivery(suppData.LearnAimRef)) .Returns(new LarsLearningDeliveryModel { LearnAimRef = suppData.LearnAimRef, LearningDeliveryGenre = genre }); var rule = new LearnAimRef06(_messageServiceMock.Object, refDataServiceMock.Object); Assert.False(rule.IsValid(suppData)); }