示例#1
0
        public async Task Delete_ItemWithInnerItems()
        {
            var rootArr = new Group[]
            {
                new Group("Test1".ToCharArray())
                {
                    InnerItems = new List <Item>()
                    {
                        new Group("Inner".ToCharArray())
                    }
                },
                new Group("Test2".ToCharArray()),
                new Group("Test3".ToCharArray())
            };

            for (int i = 0; i < rootArr.Length; i++)
            {
                await ABSRegistry.AddItemToRootAsync(rootArr[i]);
            }

            // Delete the item.
            await ABSRegistry.DeleteAsync("Test1");

            // It shouldn't exist anymore.
            Assert.IsFalse(await ABSRegistry.ExistsAsync("Test1"));
            Assert.IsFalse(await ABSRegistry.ExistsAsync("Test1/Inner"));
        }
示例#2
0
        public async Task Delete_InRoot()
        {
            // Set up the registry.
            await ABSRegistry.AddItemToRootAsync(new Group("Test1".ToCharArray()));

            await ABSRegistry.AddItemToRootAsync(new Group("Test2".ToCharArray()));

            await ABSRegistry.AddItemToRootAsync(new Group("Test3".ToCharArray()));

            // Delete the item.
            await ABSRegistry.DeleteAsync("Test2");

            // It shouldn't exist anymore.
            Assert.IsFalse(await ABSRegistry.ExistsAsync("Test2"));
        }