Esempio n. 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>();
        }
Esempio n. 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();
        }
        public AddressDetailsForViewVm GetExpectedViewModelOfShortAdrressForTest()
        {
            var expectedAddress = new AddressDetailsForViewVm()
            {
                Id      = 1,
                Address = "Aleja Wojska Polskiego 3/5",
                City    = "Kalisz",
                ZipCode = "62-800",
                Country = "Polska",
                Type    = "Adres rozliczeniowy"
            };

            return(expectedAddress);
        }
Esempio n. 4
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);
        }