Example #1
0
        public void MappingAddressDetailsForViewIsCorrectType()
        {
            //Arrange
            var                 result       = new AddressDetailsForViewVm();
            Address             testedAdress = addressesForTests.GetAdrressForTest();
            MapperConfiguration config       = GetMapperConfiguration();
            var                 mapper       = config.CreateMapper();

            //Act
            result = mapper.Map <AddressDetailsForViewVm>(testedAdress);
            //Assert
            result.Should().BeOfType <AddressDetailsForViewVm>();
        }
Example #2
0
        public void MappingAddressDetailsForViewIsNotNull()
        {
            //Arrange
            var testedAdress = addressesForTests.GetAdrressForTest();
            var config       = GetMapperConfiguration();
            var mapper       = config.CreateMapper();

            //Act
            AddressDetailsForViewVm result = mapper.Map <AddressDetailsForViewVm>(testedAdress);

            //Assert
            result.Should().NotBeNull();
        }
Example #3
0
        public void MappingAddressDetailsForViewReturnsRightModel()
        {
            //Arrange
            AddressDetailsForViewVm expected = addressesForTests.GetExpectedViewModelOfShortAdrressForTest();
            Address testedAdress             = addressesForTests.GetAdrressForTest();
            var     config = GetMapperConfiguration();

            config.AssertConfigurationIsValid();
            IMapper mapper = config.CreateMapper();

            //Act
            AddressDetailsForViewVm result = mapper.Map <AddressDetailsForViewVm>(testedAdress);

            //Assert
            result.Should().BeEquivalentTo(expected);
        }