Пример #1
0
 public void Verify_MapToSearchModel_AssignsVideoTypeSearchProperties()
 {
     // Arrange
     var mapper = new VideoTypeMapper();
     var model  = VideoTypesMockingSetup.DoMockingSetupForVideoTypeModel();
     // Act
     var searchModel = mapper.MapToSearchModel(model.Object);
     // Assert
 }
Пример #2
0
        public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new VideoTypeMapper();
            var model  = VideoTypesMockingSetup.DoMockingSetupForVideoTypeModel(1);
            var entity = VideoTypesMockingSetup.DoMockingSetupForVideoType(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
Пример #3
0
 public void Verify_MapToModelLite_AssignsLiteOnlyVideoTypeProperties()
 {
     // Arrange
     var mapper = new VideoTypeMapper();
     var entity = VideoTypesMockingSetup.DoMockingSetupForVideoType();
     // Act
     var model = mapper.MapToModelLite(entity.Object);
     // Assert
     // <None>
     // Related Objects
     // <None>
 }
Пример #4
0
        public void Verify_MapToEntityExtension_CallsMapToEntity()
        {
            // Arrange
            var mockMapper = new Mock <VideoTypeMapper>();

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <IVideoTypeModel>(), It.IsAny <int>()));
            var mockModel = VideoTypesMockingSetup.DoMockingSetupForVideoTypeModel(1);

            VideoTypeMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <IVideoTypeModel>(), It.IsAny <int>()), Times.Once);
        }
Пример #5
0
        public void Verify_MapToModel_AssignsVideoTypeProperties()
        {
            // Arrange
            var mapper = new VideoTypeMapper();
            var entity = VideoTypesMockingSetup.DoMockingSetupForVideoType();
            // Act
            var model = mapper.MapToModel(entity.Object);

            // Assert
            // <None>
            // Related Objects
            // <None>
            // Associated Objects
            Assert.Equal(entity.Object.Videos?.Count, model.Videos?.Count);
        }
Пример #6
0
        public void Verify_MapToEntity_AssignsVideoTypeProperties()
        {
            // Arrange
            var mapper = new VideoTypeMapper();
            var model  = VideoTypesMockingSetup.DoMockingSetupForVideoTypeModel();
            // Act
            var entity = mapper.MapToEntity(model.Object);

            // Assert
            // <None>
            // Related Objects
            // <None>
            // Associated Objects
            //Assert.Equal(model.Object.Videos?.Count, entity.Videos?.Count);
            model.VerifyGet(x => x.Videos, Times.Once);
        }