public void update_with_special_data_in_parent_is_invalid()
        {
            var oldDto = new GuidParentSpecialDto
            {
                ParentKey         = Guid.NewGuid(),
                OneToManyChildDto = new [] { new GuidOneToManyChildDto
                                             {
                                                 ChildKey = Guid.NewGuid()
                                             } }
            };

            var newDto = new GuidParentSpecialDto
            {
                ParentKey         = oldDto.ParentKey,
                ParentName        = "ParentNameUpdated",
                OneToManyChildDto = new [] { new GuidOneToManyChildDto
                                             {
                                                 ChildKey = oldDto.OneToManyChildDto[0].ChildKey,
                                                 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_fk_on_parent_and_special_data_in_parent_is_invalid()
        {
            var newDto = new GuidParentSpecialDto
            {
                OneToOneChildDtoNoFk = new GuidOneToOneChildDtoNoFk()
            };

            insert_maybe_inserts_in_child_and_always_in_parent(newDto, typeof(GuidOneToOneChildDtoNoFk), false);
        }
        public void delete_with_special_data_in_parent_and_child_is_invalid()
        {
            var oldDto = new GuidParentSpecialDto {
                ParentKey = Guid.NewGuid(),
                ManyToManySpecialChildDto = new [] { new GuidManyToManySpecialChildDto() }
            };

            delete_deletes_from_link_table_and_parent(oldDto, typeof(GuidManyToManySpecialChildDto), false);
        }
Пример #4
0
        public void delete_with_special_data_in_parent_and_reference_data_in_child_is_invalid()
        {
            var oldDto = new GuidParentSpecialDto
            {
                ManyToOneReferenceChildDto = new GuidManyToOneReferenceChildDto()
            };

            delete_deletes_from_parent(oldDto, false);
        }
Пример #5
0
        public void insert_with_special_data_in_parent_and_reference_data_in_child_is_invalid()
        {
            var newDto = new GuidParentSpecialDto
            {
                ManyToOneReferenceChildDto = new GuidManyToOneReferenceChildDto()
            };

            insert_inserts_in_parent(newDto, false);
        }
        public void insert_with_special_data_in_parent_is_invalid()
        {
            var newDto = new GuidParentSpecialDto
            {
                OneToManyChildDto = new [] { new GuidOneToManyChildDto() }
            };

            var cache = new DtoMetadataCache();

            GetCommands(cache, null, newDto, 2, 2, 2, 0, 0, 2, 2, 0, 0, false);
        }
        public void insert_with_special_data_in_parent_and_reference_data_in_child_is_invalid()
        {
            var newDto = new GuidParentSpecialDto()
            {
                ManyToManyReferenceChildDto = new [] { new GuidManyToManyReferenceChildDto() }
            };

            var cache = new DtoMetadataCache();

            GetCommands(cache, null, newDto, 2, 2, 2, 0, 0, 2, 2, 0, 0, false);
        }
        public void delete_with_special_data_in_parent_is_invalid()
        {
            var oldDto = new GuidParentSpecialDto
            {
                ParentKey         = Guid.NewGuid(),
                OneToManyChildDto = new [] { new GuidOneToManyChildDto {
                                                 ChildKey = Guid.NewGuid()
                                             } }
            };

            var cache = new DtoMetadataCache();

            GetCommands(cache, oldDto, null, 2, 2, 0, 0, 2, 2, 0, 0, 2, false);
        }
        public void update_with_fk_on_parent_and_special_data_in_parent_is_invalid()
        {
            var oldDto = new GuidParentSpecialDto
            {
                ParentKey            = Guid.NewGuid(),
                OneToOneChildDtoNoFk = new GuidOneToOneChildDtoNoFk()
            };

            var newDto = new GuidParentSpecialDto
            {
                ParentKey            = oldDto.ParentKey,
                ParentName           = "I will fight you",
                OneToOneChildDtoNoFk = new GuidOneToOneChildDtoNoFk()
            };

            update_updates_in_parent_and_maybe_child(oldDto, newDto, typeof(GuidOneToOneChildDtoNoFk), 1, false, false);
        }
        public void update_with_special_data_in_parent_and_child_is_invalid()
        {
            var oldDto = new GuidParentSpecialDto {
                ParentKey = Guid.NewGuid(),
                ManyToManySpecialChildDto = new [] { new GuidManyToManySpecialChildDto() }
            };

            var newDto = new GuidParentSpecialDto {
                ParentKey  = oldDto.ParentKey,
                ParentName = "Wibble",
                ManyToManySpecialChildDto = new [] { new GuidManyToManySpecialChildDto
                                                     {
                                                         ChildKey = oldDto.ManyToManySpecialChildDto[0].ChildKey
                                                     } }
            };

            var cache = new DtoMetadataCache();

            GetCommands(cache, oldDto, newDto, 1, 1, 0, 1, 0, 1, 0, 1, 0, false);
        }
Пример #11
0
        public void update_with_special_data_in_parent_and_reference_data_in_child_is_invalid()
        {
            var oldDto = new GuidParentSpecialDto
            {
                ParentKey = Guid.NewGuid(),
                ManyToOneReferenceChildDto = new GuidManyToOneReferenceChildDto()
            };

            var newDto = new GuidParentSpecialDto
            {
                ParentKey  = oldDto.ParentKey,
                ParentName = "Now that we've found love what are we gonna do with it?",
                ManyToOneReferenceChildDto = new GuidManyToOneReferenceChildDto
                {
                    ChildKey = oldDto.ManyToOneReferenceChildDto.ChildKey
                }
            };

            update_updates_parent(oldDto, newDto, false);
        }
        public void delete_with_special_data_in_parent_is_invalid() {
            var oldDto = new GuidParentSpecialDto
            {
                ParentKey = Guid.NewGuid(),
                OneToManyChildDto = new [] { new GuidOneToManyChildDto { ChildKey = Guid.NewGuid() } }
            };

            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 GuidParentSpecialDto
            {
                ParentKey = Guid.NewGuid(),
                OneToManyChildDto = new [] { new GuidOneToManyChildDto
                {
                    ChildKey = Guid.NewGuid()
                } }
            };

            var newDto = new GuidParentSpecialDto
            {
                ParentKey = oldDto.ParentKey,
                ParentName = "ParentNameUpdated",
                OneToManyChildDto = new [] { new GuidOneToManyChildDto
                {
                    ChildKey = oldDto.OneToManyChildDto[0].ChildKey,
                    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 GuidParentSpecialDto
            {
                OneToManyChildDto = new [] { new GuidOneToManyChildDto() }
            };

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