Пример #1
0
        public void GivenFromContactPersonTOContactPersonDTO_WhenGivenContactPerson_ThenCreateContactPersonDTO()
        {
            var memstub    = Substitute.For <IMemberServices>();
            var stubMapper = Substitute.For <IContactPersonMapper>();
            ContactPersonMapper cmapper = new ContactPersonMapper(new AddressMapper(new CityMapper(memstub)));
            var city = City.CreateCity(2050, "Antwerpen", "Belgium");

            var contactPerson = ContactPerson.CreateNewContactPerson("lasr", "peelman", Address.CreateAddress("test", "5", city), "*****@*****.**", "5454548564", "5456456456");

            var result = cmapper.FromContactPersonTOContactPersonDTO(contactPerson);

            Assert.IsType <ContactPersonDTO>(result);
        }
Пример #2
0
        public void GivenFromContactPersonDTOTOContactPerson_WhenGivenContactPersonDTO_ThenCreateContactPerson()
        {
            var memstub    = Substitute.For <IMemberServices>();
            var stubMapper = Substitute.For <IContactPersonMapper>();
            ContactPersonMapper cmapper = new ContactPersonMapper(new AddressMapper(new CityMapper(memstub)));
            var cityDTO = new CityDTO {
                ZIP = 2050, CityName = "Antwerpen", CountryName = "Belgium"
            };

            var addres = new AddressDTO {
                StreetName = "teststreet", StreetNumber = "58", CityDTO = cityDTO
            };
            var contactPerson = new ContactPersonDTO {
                FirstName = "lars", Address = addres, Email = "*****@*****.**", LastName = "peelman", MobilePhoneNumber = "55555", PhoneNumber = "55555"
            };

            var result = cmapper.FromContactPersonDTOTOContactPerson(contactPerson);

            Assert.IsType <ContactPerson>(result);
        }