Beispiel #1
0
 public void Verify_MapToSearchModel_AssignsStudioSearchProperties()
 {
     // Arrange
     var mapper = new StudioMapper();
     var model  = StudiosMockingSetup.DoMockingSetupForStudioModel();
     // Act
     var searchModel = mapper.MapToSearchModel(model.Object);
     // Assert
 }
Beispiel #2
0
        public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new StudioMapper();
            var model  = StudiosMockingSetup.DoMockingSetupForStudioModel(1);
            var entity = StudiosMockingSetup.DoMockingSetupForStudio(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
Beispiel #3
0
 public void Verify_MapToModelLite_AssignsLiteOnlyStudioProperties()
 {
     // Arrange
     var mapper = new StudioMapper();
     var entity = StudiosMockingSetup.DoMockingSetupForStudio();
     // Act
     var model = mapper.MapToModelLite(entity.Object);
     // Assert
     // <None>
     // Related Objects
     // <None>
 }
Beispiel #4
0
        public void Verify_MapToEntityExtension_CallsMapToEntity()
        {
            // Arrange
            var mockMapper = new Mock <StudioMapper>();

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <IStudioModel>(), It.IsAny <int>()));
            var mockModel = StudiosMockingSetup.DoMockingSetupForStudioModel(1);

            StudioMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <IStudioModel>(), It.IsAny <int>()), Times.Once);
        }
Beispiel #5
0
        public void Verify_MapToModel_AssignsStudioProperties()
        {
            // Arrange
            var mapper = new StudioMapper();
            var entity = StudiosMockingSetup.DoMockingSetupForStudio();
            // Act
            var model = mapper.MapToModel(entity.Object);

            // Assert
            // <None>
            // Related Objects
            // <None>
            // Associated Objects
            Assert.Equal(entity.Object.MovieStudios?.Count, model.MovieStudios?.Count);
        }
Beispiel #6
0
        public void Verify_AreEqualExtension_CallsAreEqual()
        {
            // Arrange
            var mockMapper = new Mock <StudioMapper>();

            mockMapper.Setup(x => x.AreEqual(It.IsAny <IStudioModel>(), It.IsAny <IStudio>()));
            StudioMapperExtensions.OverrideMapper(mockMapper.Object);
            var mockModel  = StudiosMockingSetup.DoMockingSetupForStudioModel(1);
            var mockEntity = StudiosMockingSetup.DoMockingSetupForStudio(1);

            // Act
            mockModel.Object.AreEqual(mockEntity.Object);
            // Assert
            mockMapper.Verify(x => x.AreEqual(It.IsAny <IStudioModel>(), It.IsAny <IStudio>()), Times.Once);
        }
Beispiel #7
0
        public void Verify_MapToEntity_AssignsStudioProperties()
        {
            // Arrange
            var mapper = new StudioMapper();
            var model  = StudiosMockingSetup.DoMockingSetupForStudioModel();
            // Act
            var entity = mapper.MapToEntity(model.Object);

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