Пример #1
0
        public async Task SplitPath_Nothing_EmptyPath()
        {
            var expected = new List <List <char> >();

            CollectionAssert.AreEqual(expected, await ABSRegistry.SplitPathAsync(""));
            CollectionAssert.AreEqual(expected, await ABSRegistry.SplitPathAsync(new char[0]));
        }
Пример #2
0
        public async Task SplitPath_RootOnly_EmptyPath()
        {
            var expected = new List <List <char> >();

            CollectionAssert.AreEqual(expected, await ABSRegistry.SplitPathAsync("/"));
            CollectionAssert.AreEqual(expected, await ABSRegistry.SplitPathAsync(new char[] { '/' }));
            CollectionAssert.AreEqual(expected, await ABSRegistry.SplitPathAsync("\\"));
            CollectionAssert.AreEqual(expected, await ABSRegistry.SplitPathAsync(new char[] { '\\' }));
        }
Пример #3
0
        public async Task SplitPath_GroupInRoot()
        {
            var expected = new List <List <char> >()
            {
                new List <char>()
                {
                    'A', 'B', 'P', 'a', 'i', 'n', 't'
                }
            };

            Assert.IsTrue(TestArr(expected, await ABSRegistry.SplitPathAsync("ABPaint")));
            Assert.IsTrue(TestArr(expected, await ABSRegistry.SplitPathAsync("/ABPaint")));
            Assert.IsTrue(TestArr(expected, await ABSRegistry.SplitPathAsync("\\ABPaint")));
        }
Пример #4
0
        public async Task SplitPath_MultipleParts()
        {
            var expected = new List <List <char> >()
            {
                new List <char>()
                {
                    'A', 'B', 'P', 'a', 'i', 'n', 't'
                },
                new List <char>()
                {
                    'N', 'e', 'x', 't'
                },
                new List <char>()
                {
                    'A', 'n', 'o', 't', 'h', 'e', 'r'
                }
            };

            Assert.IsTrue(TestArr(expected, await ABSRegistry.SplitPathAsync("ABPaint/Next/Another")));
            Assert.IsTrue(TestArr(expected, await ABSRegistry.SplitPathAsync("/ABPaint/Next/Another")));
            Assert.IsTrue(TestArr(expected, await ABSRegistry.SplitPathAsync("ABPaint\\Next\\Another")));
            Assert.IsTrue(TestArr(expected, await ABSRegistry.SplitPathAsync("\\ABPaint\\Next\\Another")));
        }