예제 #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);
        }
예제 #2
0
        public void Verify_MapToModelLite_AssignsLiteOnlyEpisodeStoryArcFirstAppearanceProperties()
        {
            // Arrange
            var mapper = new EpisodeStoryArcFirstAppearanceMapper();
            var entity = EpisodeStoryArcFirstAppearancesMockingSetup.DoMockingSetupForEpisodeStoryArcFirstAppearance();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(entity.Object.EpisodeId, model.EpisodeId);
            Assert.Equal(entity.Object.StoryArcId, model.StoryArcId);
        }
예제 #3
0
        public void Verify_MapToModelListingExtension_CallsMapToModel()
        {
            // Arrange
            var mockMapper = new Mock <EpisodeStoryArcFirstAppearanceMapper>();

            mockMapper.Setup(x => x.MapToModelListing(It.IsAny <IEpisodeStoryArcFirstAppearance>(), It.IsAny <int>()));
            var mockEntity = EpisodeStoryArcFirstAppearancesMockingSetup.DoMockingSetupForEpisodeStoryArcFirstAppearance(1);

            EpisodeStoryArcFirstAppearanceMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockEntity.Object.MapToModelListing();
            // Assert
            mockMapper.Verify(x => x.MapToModelListing(It.IsAny <IEpisodeStoryArcFirstAppearance>(), It.IsAny <int>()), Times.Once);
        }