Exemplo n.º 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"));
        }
Exemplo n.º 2
0
        public async Task Exists_InRoot_DoesExist()
        {
            // 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()));

            Assert.IsTrue(await ABSRegistry.ExistsAsync("Test1"));
            Assert.IsTrue(await ABSRegistry.ExistsAsync("/Test1"));
        }
Exemplo n.º 3
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"));
        }
Exemplo n.º 4
0
        public async Task Exists_MultipleParts_DoesExist()
        {
            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]);
            }

            Assert.IsTrue(await ABSRegistry.ExistsAsync("Test1/Inner"));
            Assert.IsTrue(await ABSRegistry.ExistsAsync("/Test1/Inner"));
        }
Exemplo n.º 5
0
 public async Task Exists_RootItself_DoesExist()
 {
     Assert.IsTrue(await ABSRegistry.ExistsAsync("/"));
 }
Exemplo n.º 6
0
 public async Task Exists_MultipleParts_DoesNotExist()
 {
     Assert.IsFalse(await ABSRegistry.ExistsAsync("Test1/Another"));
     Assert.IsFalse(await ABSRegistry.ExistsAsync("/Test1/Another"));
 }
Exemplo n.º 7
0
 public async Task Exists_InRoot_DoesNotExist()
 {
     Assert.IsFalse(await ABSRegistry.ExistsAsync("Test1"));
     Assert.IsFalse(await ABSRegistry.ExistsAsync("/Test1"));
 }