示例#1
0
        public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new EpisodeConceptMapper();
            var model  = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConceptModel(1);
            var entity = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConcept(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
示例#2
0
        public void Verify_MapToEntityExtension_CallsMapToEntity()
        {
            // Arrange
            var mockMapper = new Mock <EpisodeConceptMapper>();

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <IEpisodeConceptModel>(), It.IsAny <int>()));
            var mockModel = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConceptModel(1);

            EpisodeConceptMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <IEpisodeConceptModel>(), It.IsAny <int>()), Times.Once);
        }
示例#3
0
        public void Verify_MapToModelLite_AssignsLiteOnlyEpisodeConceptProperties()
        {
            // Arrange
            var mapper = new EpisodeConceptMapper();
            var entity = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConcept();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(entity.Object.EpisodeId, model.EpisodeId);
            Assert.Equal(entity.Object.ConceptId, model.ConceptId);
        }
示例#4
0
        public void Verify_MapToEntity_AssignsEpisodeConceptProperties()
        {
            // Arrange
            var mapper = new EpisodeConceptMapper();
            var model  = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConceptModel();
            // Act
            var entity = mapper.MapToEntity(model.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.EpisodeId, entity.EpisodeId);
            Assert.Equal(model.Object.ConceptId, entity.ConceptId);
            // Associated Objects
            // <None>
        }
示例#5
0
        public void Verify_MapToSearchModel_AssignsEpisodeConceptSearchProperties()
        {
            // Arrange
            var mapper = new EpisodeConceptMapper();
            var model  = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConceptModel();
            // Act
            var searchModel = mapper.MapToSearchModel(model.Object);

            // Assert
            Assert.Equal(model.Object.EpisodeId, searchModel.EpisodeId);
            Assert.Equal(model.Object.Episode?.CustomKey, searchModel.EpisodeCustomKey);
            Assert.Equal(model.Object.Episode?.ApiDetailUrl, searchModel.EpisodeApiDetailUrl);
            Assert.Equal(model.Object.Episode?.SiteDetailUrl, searchModel.EpisodeSiteDetailUrl);
            Assert.Equal(model.Object.Episode?.Name, searchModel.EpisodeName);
            Assert.Equal(model.Object.Episode?.ShortDescription, searchModel.EpisodeShortDescription);
            Assert.Equal(model.Object.Episode?.Description, searchModel.EpisodeDescription);
            Assert.Equal(model.Object.ConceptId, searchModel.ConceptId);
            Assert.Equal(model.Object.Concept?.CustomKey, searchModel.ConceptCustomKey);
            Assert.Equal(model.Object.Concept?.ApiDetailUrl, searchModel.ConceptApiDetailUrl);
            Assert.Equal(model.Object.Concept?.SiteDetailUrl, searchModel.ConceptSiteDetailUrl);
            Assert.Equal(model.Object.Concept?.Name, searchModel.ConceptName);
            Assert.Equal(model.Object.Concept?.ShortDescription, searchModel.ConceptShortDescription);
            Assert.Equal(model.Object.Concept?.Description, searchModel.ConceptDescription);
        }