Пример #1
0
        public void Should_be_able_to_copy_with_excluded_member()
        {
            ObjectToCopy source = new ObjectToCopy
                                      {
                                          Id = 10,
                                          Name = "A dummy name",
                                          Address = "A dummy address"
                                      };

            ObjectToCopy destination = new ObjectToCopy();

            copier.Copy(source, destination, "Id", "Address");

            Assert.Equal(0, destination.Id);
            Assert.Equal("A dummy name", destination.Name);
            Assert.Null(destination.Address);
        }
Пример #2
0
        public void Should_be_able_to_copy_with_excluded_member()
        {
            ObjectToCopy source = new ObjectToCopy
            {
                Id      = 10,
                Name    = "A dummy name",
                Address = "A dummy address"
            };

            ObjectToCopy destination = new ObjectToCopy();

            copier.Copy(source, destination, "Id", "Address");

            Assert.Equal(0, destination.Id);
            Assert.Equal("A dummy name", destination.Name);
            Assert.Null(destination.Address);
        }
Пример #3
0
        public void Should_be_able_to_copy_objects()
        {
            ObjectToCopy source = new ObjectToCopy
                                      {
                                          Id = 10,
                                          Name = "A dummy name",
                                          Address = "A dummy address"
                                      };

            ObjectToCopy destination = new ObjectToCopy();

            copier.Copy(source, destination);

            Assert.Equal(10, destination.Id);
            Assert.Equal("A dummy name", destination.Name);
            Assert.Equal("A dummy address", destination.Address);
        }
Пример #4
0
        public void Should_be_able_to_copy_objects()
        {
            ObjectToCopy source = new ObjectToCopy
            {
                Id      = 10,
                Name    = "A dummy name",
                Address = "A dummy address"
            };

            ObjectToCopy destination = new ObjectToCopy();

            copier.Copy(source, destination);

            Assert.Equal(10, destination.Id);
            Assert.Equal("A dummy name", destination.Name);
            Assert.Equal("A dummy address", destination.Address);
        }