コード例 #1
0
        public void TestApplyNewValues()
        {
            ContactInformation contactInformation1 = new ContactInformation()
            {
                Phone = "phone1", Email = "*****@*****.**"
            };
            ContactInformation contactInformation2 = new ContactInformation()
            {
                Phone = "phone2", Email = "*****@*****.**"
            };
            var customer1 = new Customer()
            {
                Name = "Customer1", ContactInformation = contactInformation1
            };
            var customer2 = new Customer()
            {
                Name = "Customer2", ContactInformation = contactInformation2
            };


            customerRepository.Apply(customer1, customer2);

            customer1.Name.Should().Be(customer2.Name, "Different name.");
            customer1.ContactInformation.Phone.Should().NotBe(customer2.ContactInformation.Phone, "Same name.");
            customer1.ContactInformation.Email.Should().NotBe(customer2.ContactInformation.Email, "Same email.");
        }