Exemplo n.º 1
0
        public void CanCreate_CanAddAddressWithSameName_ShouldReplace()
        {
            var customer = new CustomerBuilder().WithDefaults().Build();

            customer.AddAddress(
                "Home",
                "1 My Street",
                "My Town",
                "AB1 1UT",
                "United Kingdom");

            customer.AddAddress(
                "Home",
                "2 My Street",
                "My Town",
                "AB1 1UT",
                "United Kingdom");

            customer.Addresses.Count.Should().Be(1);
            customer.Addresses.FirstOrDefault().AddressLine1.Should().Be("2 My Street");
        }
Exemplo n.º 2
0
        public void CanCreate_CanAddAddress()
        {
            var customer = new CustomerBuilder().WithDefaults().Build();

            customer.AddAddress(
                "Home",
                "1 My Street",
                "My Town",
                "AB1 1UT",
                "United Kingdom");

            customer.Addresses.Count.Should().Be(1);
        }