Exemplo n.º 1
0
 public void Verify_MapToSearchModel_AssignsOriginSearchProperties()
 {
     // Arrange
     var mapper = new OriginMapper();
     var model  = OriginsMockingSetup.DoMockingSetupForOriginModel();
     // Act
     var searchModel = mapper.MapToSearchModel(model.Object);
     // Assert
 }
Exemplo n.º 2
0
        public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new OriginMapper();
            var model  = OriginsMockingSetup.DoMockingSetupForOriginModel(1);
            var entity = OriginsMockingSetup.DoMockingSetupForOrigin(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
Exemplo n.º 3
0
        public void Verify_MapToModelLite_AssignsLiteOnlyOriginProperties()
        {
            // Arrange
            var mapper = new OriginMapper();
            var entity = OriginsMockingSetup.DoMockingSetupForOrigin();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            Assert.Equal(entity.Object.CharacterSet, model.CharacterSet);
            // Related Objects
            // <None>
        }
Exemplo n.º 4
0
        public void Verify_MapToEntityExtension_CallsMapToEntity()
        {
            // Arrange
            var mockMapper = new Mock <OriginMapper>();

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <IOriginModel>(), It.IsAny <int>()));
            var mockModel = OriginsMockingSetup.DoMockingSetupForOriginModel(1);

            OriginMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <IOriginModel>(), It.IsAny <int>()), Times.Once);
        }
Exemplo n.º 5
0
        public void Verify_MapToModel_AssignsOriginProperties()
        {
            // Arrange
            var mapper = new OriginMapper();
            var entity = OriginsMockingSetup.DoMockingSetupForOrigin();
            // Act
            var model = mapper.MapToModel(entity.Object);

            // Assert
            Assert.Equal(entity.Object.CharacterSet, model.CharacterSet);
            // Related Objects
            // <None>
            // Associated Objects
            Assert.Equal(entity.Object.OriginProfiles?.Count, model.OriginProfiles?.Count);
        }
Exemplo n.º 6
0
        public void Verify_AreEqualExtension_CallsAreEqual()
        {
            // Arrange
            var mockMapper = new Mock <OriginMapper>();

            mockMapper.Setup(x => x.AreEqual(It.IsAny <IOriginModel>(), It.IsAny <IOrigin>()));
            OriginMapperExtensions.OverrideMapper(mockMapper.Object);
            var mockModel  = OriginsMockingSetup.DoMockingSetupForOriginModel(1);
            var mockEntity = OriginsMockingSetup.DoMockingSetupForOrigin(1);

            // Act
            mockModel.Object.AreEqual(mockEntity.Object);
            // Assert
            mockMapper.Verify(x => x.AreEqual(It.IsAny <IOriginModel>(), It.IsAny <IOrigin>()), Times.Once);
        }
Exemplo n.º 7
0
        public void Verify_MapToEntity_AssignsOriginProperties()
        {
            // Arrange
            var mapper = new OriginMapper();
            var model  = OriginsMockingSetup.DoMockingSetupForOriginModel();
            // Act
            var entity = mapper.MapToEntity(model.Object);

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