Esempio 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
 }
Esempio 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }