Esempio n. 1
0
        public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new EpisodeStoryArcFirstAppearanceMapper();
            var model  = EpisodeStoryArcFirstAppearancesMockingSetup.DoMockingSetupForEpisodeStoryArcFirstAppearanceModel(1);
            var entity = EpisodeStoryArcFirstAppearancesMockingSetup.DoMockingSetupForEpisodeStoryArcFirstAppearance(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
Esempio n. 2
0
        public void Verify_MapToEntityExtension_CallsMapToEntity()
        {
            // Arrange
            var mockMapper = new Mock <EpisodeStoryArcFirstAppearanceMapper>();

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <IEpisodeStoryArcFirstAppearanceModel>(), It.IsAny <int>()));
            var mockModel = EpisodeStoryArcFirstAppearancesMockingSetup.DoMockingSetupForEpisodeStoryArcFirstAppearanceModel(1);

            EpisodeStoryArcFirstAppearanceMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <IEpisodeStoryArcFirstAppearanceModel>(), It.IsAny <int>()), Times.Once);
        }
Esempio n. 3
0
        public void Verify_MapToEntity_AssignsEpisodeStoryArcFirstAppearanceProperties()
        {
            // Arrange
            var mapper = new EpisodeStoryArcFirstAppearanceMapper();
            var model  = EpisodeStoryArcFirstAppearancesMockingSetup.DoMockingSetupForEpisodeStoryArcFirstAppearanceModel();
            // Act
            var entity = mapper.MapToEntity(model.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.EpisodeId, entity.EpisodeId);
            Assert.Equal(model.Object.StoryArcId, entity.StoryArcId);
            // Associated Objects
            // <None>
        }
Esempio n. 4
0
        public void Verify_MapToSearchModel_AssignsEpisodeStoryArcFirstAppearanceSearchProperties()
        {
            // Arrange
            var mapper = new EpisodeStoryArcFirstAppearanceMapper();
            var model  = EpisodeStoryArcFirstAppearancesMockingSetup.DoMockingSetupForEpisodeStoryArcFirstAppearanceModel();
            // 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.StoryArcId, searchModel.StoryArcId);
            Assert.Equal(model.Object.StoryArc?.CustomKey, searchModel.StoryArcCustomKey);
            Assert.Equal(model.Object.StoryArc?.ApiDetailUrl, searchModel.StoryArcApiDetailUrl);
            Assert.Equal(model.Object.StoryArc?.SiteDetailUrl, searchModel.StoryArcSiteDetailUrl);
            Assert.Equal(model.Object.StoryArc?.Name, searchModel.StoryArcName);
            Assert.Equal(model.Object.StoryArc?.ShortDescription, searchModel.StoryArcShortDescription);
            Assert.Equal(model.Object.StoryArc?.Description, searchModel.StoryArcDescription);
        }