Example #1
0
        public async Task AddItemAt_AddToRoot()
        {
            var groupName = "Test".ToCharArray();

            // Add the item.
            await ABSRegistry.AddItemAtAsync("", new Group(groupName));

            // Make sure that group exists.
            CollectionAssert.AreEqual(groupName, ABSRegistry.RegistryItems[0].Name);
        }
Example #2
0
        public async Task AddItemAt_InOtherGroup_NotGroup()
        {
            var groupName = "NewGroup".ToCharArray();

            // Set up the registry.
            await ABSRegistry.AddItemToRootAsync(new Group("Test1".ToCharArray()));

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

            // Add the item.
            await ABSRegistry.AddItemAtAsync("Test1", new Group(groupName));

            // Make sure that group exists.
            CollectionAssert.AreEqual(groupName, (ABSRegistry.RegistryItems[0] as Group).InnerItems[0].Name);
        }
Example #3
0
        public async Task AddItemAt_InOtherGroup_AlreadyExists()
        {
            // 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()));

            // Add the item.
            await ABSRegistry.AddItemAtAsync("Test1", new Group("NewGroup".ToCharArray()));

            try
            {
                await ABSRegistry.AddItemAtAsync("Test1", new Group("NewGroup".ToCharArray()));

                // An exception should have been thrown.
                Assert.Fail();
            }
            catch (Exception) { }
        }