Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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));
        }