public void CheckSetCustomerEmail() { Mock <ICustomerRepository> repositoryMock = new Mock <ICustomerRepository>(); ShopService ss = new ShopService(repositoryMock.Object); var customer = CustomerObjectMother.CreateCustomerWithNoAddress(); string email = "*****@*****.**"; ss.SetCustomerEmail(customer, email); Assert.AreEqual(customer.Email, email); }
public void CheckAddAddressToCustomer() { // Arrange var customer = CustomerObjectMother.CreateCustomerWithNoAddress(); var address = CustomerObjectMother.CreateAddressWithCityWroclaw(1); customer.Address = address; // Assert Assert.IsTrue(customer.Address.City == "Wroclaw"); }
public void CheckSetCustomerAddress() { Mock <ICustomerRepository> repositoryMock = new Mock <ICustomerRepository>(); ShopService ss = new ShopService(repositoryMock.Object); var customer = CustomerObjectMother.CreateCustomerWithNoAddress(); string street = "Sliczna"; string city = "Wroclaw"; string state = "Lower Silesia"; string country = "Poland"; string zipCode = "50-363"; ss.SetCustomerAddress(customer, street, city, state, country, zipCode); Assert.AreEqual(customer.Address.Street, street); Assert.AreEqual(customer.Address.City, city); Assert.AreEqual(customer.Address.State, state); Assert.AreEqual(customer.Address.Country, country); Assert.AreEqual(customer.Address.ZipCode, zipCode); }