Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public void CheckAddAddressToCustomer()
        {
            // Arrange
            var customer = CustomerObjectMother.CreateCustomerWithNoAddress();
            var address  = CustomerObjectMother.CreateAddressWithCityWroclaw(1);

            customer.Address = address;


            // Assert
            Assert.IsTrue(customer.Address.City == "Wroclaw");
        }
Ejemplo n.º 3
0
        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);
        }