コード例 #1
0
        public void TestDtoToAddress()
        {
            CustomerDTO customerDTO = new CustomerDTO();

            customerDTO.MarkChildForInsertion(new AddressDTO {
                Id = 1, City = "FakeCity", Email = "FakeEmail", Phone = "09", PostalCode = "1234", AddressLine1 = "FakeStreet", Version = 0
            });
            customerDTO.MarkChildForUpdate(new AddressDTO {
                Id = 2, City = "FakeCity", Email = "FakeEmail", Phone = "09", PostalCode = "1234", AddressLine1 = "FakeStreet", Version = 0
            });
            customerDTO.MarkChildForDeletion(new AddressDTO {
                Id = 3, City = "FakeCity", Email = "FakeEmail", Phone = "09", PostalCode = "1234", AddressLine1 = "FakeStreet", Version = 0
            });

            IEnumerable <ChangeItem> changeItems = CustomerAdapter.GetChangeItems(customerDTO, new Customer());

            Assert.AreEqual <int>(3, changeItems.Count());
        }