Beispiel #1
0
 public void Verify_MapToSearchModel_AssignsOriginSearchProperties()
 {
     // Arrange
     var mapper = new OriginMapper();
     var model  = OriginsMockingSetup.DoMockingSetupForOriginModel();
     // Act
     var searchModel = mapper.MapToSearchModel(model.Object);
     // Assert
 }
Beispiel #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);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
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);
        }