Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
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>
        }
Ejemplo n.º 4
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);
        }