Example #1
0
        public void update_with_special_data_in_parent_is_invalid()
        {
            var oldDto = new ParentSpecialDto
            {
                ParentKey         = 1,
                OneToManyChildDto = new [] { new OneToManyChildDto
                                             {
                                                 ChildKey = 2
                                             } }
            };

            var newDto = new ParentSpecialDto
            {
                ParentKey         = 1,
                ParentName        = "ParentNameUpdated",
                OneToManyChildDto = new [] { new OneToManyChildDto
                                             {
                                                 ChildKey = 2,
                                                 Name     = "Maximum Whoopee! Enabled"
                                             } }
            };

            var cache = new DtoMetadataCache();

            GetCommands(cache, oldDto, newDto, 2, 2, 0, 2, 0, 2, 0, 2, 0, false);
        }
        public void delete_with_special_data_in_parent_and_reference_data_in_child_is_invalid()
        {
            var oldDto = new ParentSpecialDto
            {
                ManyToOneReferenceChildDto = new ManyToOneReferenceChildDto()
            };

            delete_deletes_from_parent(oldDto, false);
        }
        public void insert_with_special_data_in_parent_and_reference_data_in_child_is_invalid()
        {
            var newDto = new ParentSpecialDto
            {
                ManyToOneReferenceChildDto = new ManyToOneReferenceChildDto()
            };

            insert_inserts_in_parent(newDto, false);
        }
        public void delete_with_special_data_in_parent_and_child_is_invalid()
        {
            var oldDto = new ParentSpecialDto {
                ParentKey = 1,
                ManyToManySpecialChildDto = new [] { new ManyToManySpecialChildDto() }
            };

            delete_deletes_from_link_table_and_parent(oldDto, typeof(ManyToManySpecialChildDto), false);
        }
        public void delete_with_fk_on_parent_and_special_data_in_parent_is_invalid()
        {
            var newDto = new ParentSpecialDto
            {
                OneToOneChildDtoNoFk = new OneToOneChildDtoNoFk()
            };

            insert_maybe_inserts_in_child_and_always_in_parent(newDto, typeof(OneToOneChildDtoNoFk), false);
        }
        public void insert_with_special_data_in_parent_and_child_is_invalid()
        {
            var newDto = new ParentSpecialDto()
            {
                ManyToManySpecialChildDto = new [] { new ManyToManySpecialChildDto() }
            };

            var cache = new DtoMetadataCache();

            GetCommands(cache, null, newDto, 2, 2, 2, 0, 0, 2, 2, 0, 0, false);
        }
Example #7
0
        public void delete_with_special_data_in_parent_is_invalid()
        {
            var oldDto = new ParentSpecialDto
            {
                ParentKey         = 1,
                OneToManyChildDto = new [] { new OneToManyChildDto {
                                                 ChildKey = 1
                                             } }
            };

            var cache = new DtoMetadataCache();

            GetCommands(cache, oldDto, null, 2, 2, 0, 0, 2, 2, 0, 0, 2, false);
        }
        public void update_with_special_data_in_parent_and_reference_data_in_child_is_invalid()
        {
            var oldDto = new ParentSpecialDto
            {
                ParentKey = 5462,
                ManyToOneReferenceChildDto = new ManyToOneReferenceChildDto()
            };

            var newDto = new ParentSpecialDto
            {
                ParentKey  = 5462,
                ParentName = "Now that we've found love what are we gonna do with it?",
                ManyToOneReferenceChildDto = new ManyToOneReferenceChildDto()
            };

            update_updates_parent(oldDto, newDto, false);
        }
        public void update_with_special_data_in_parent_and_child_is_invalid()
        {
            var oldDto = new ParentSpecialDto {
                ParentKey = 1,
                ManyToManySpecialChildDto = new [] { new ManyToManySpecialChildDto() }
            };

            var newDto = new ParentSpecialDto {
                ParentKey  = 1,
                ParentName = "Wibble",
                ManyToManySpecialChildDto = new [] { new ManyToManySpecialChildDto() }
            };

            var cache = new DtoMetadataCache();

            GetCommands(cache, oldDto, newDto, 1, 1, 0, 1, 0, 1, 0, 1, 0, false);
        }
        public void update_with_fk_on_parent_and_special_data_in_parent_is_invalid()
        {
            var oldDto = new ParentSpecialDto
            {
                ParentKey            = 52879,
                OneToOneChildDtoNoFk = new OneToOneChildDtoNoFk()
            };

            var newDto = new ParentSpecialDto
            {
                ParentKey            = 52879,
                ParentName           = "I will fight you",
                OneToOneChildDtoNoFk = new OneToOneChildDtoNoFk()
            };

            update_updates_in_parent_and_maybe_child(oldDto, newDto, typeof(OneToOneChildDtoNoFk), 1, false, false);
        }
        public void delete_with_special_data_in_parent_is_invalid() {
            var oldDto = new ParentSpecialDto
            {
                ParentKey = 1,
                OneToManyChildDto = new [] { new OneToManyChildDto { ChildKey = 1 } }
            };

            var cache = new DtoMetadataCache();
            GetCommands(cache, oldDto, null, 2, 2, 0, 0, 2, 2, 0, 0, 2, false);
        }
        public void update_with_special_data_in_parent_is_invalid() {
            var oldDto = new ParentSpecialDto
            {
                ParentKey = 1,
                OneToManyChildDto = new [] { new OneToManyChildDto
                {
                    ChildKey = 2
                } }
            };

            var newDto = new ParentSpecialDto
            {
                ParentKey = 1,
                ParentName = "ParentNameUpdated",
                OneToManyChildDto = new [] { new OneToManyChildDto
                {
                    ChildKey = 2,
                    Name = "Maximum Whoopee! Enabled"
                } }
            };

            var cache = new DtoMetadataCache();
            GetCommands(cache, oldDto, newDto, 2, 2, 0, 2, 0, 2, 0, 2, 0, false);
        }
        public void insert_with_special_data_in_parent_is_invalid() {
            var newDto = new ParentSpecialDto
            {
                OneToManyChildDto = new [] { new OneToManyChildDto() }
            };

            var cache = new DtoMetadataCache();
            GetCommands(cache, null, newDto, 2, 2, 2, 0, 0, 2, 2, 0, 0, false);
        }