Пример #1
0
        public void CheckReduceForDuplication()
        {
            var input = new List <string>
            {
                @"C:\A",
                @"C:\A",
            };

            var reduction = new PathReductor();
            var output    = reduction.Reduce(input);

            Assert.AreEqual(1, output.Count);
        }
Пример #2
0
        public void CheckReduceFromDifferentBasePaths()
        {
            var input = new List <string>
            {
                @"C:\images\m02\d01",
                @"C:\images\m01\"
            };

            var           reduction = new PathReductor();
            List <string> output    = reduction.Reduce(input);

            Assert.IsNotNull(output);
            Assert.AreEqual(2, output.Count);
        }
Пример #3
0
        public void ReduceNestedDirectory()
        {
            var input = new List <string>
            {
                @"C:\images\m01\d01",
                @"C:\images\m01\"
            };

            var           reduction = new PathReductor();
            List <string> output    = reduction.Reduce(input);

            Assert.IsNotNull(output);
            Assert.AreEqual(1, output.Count);
            Assert.AreEqual(@"C:\images\m01\", output[0]);
        }
Пример #4
0
        public void CheckReduceForTwoBasePaths()
        {
            var input = new List <string>
            {
                @"C:\A\B\C",
                @"C:\A",
                @"C:\images\m01\d01",
                @"C:\images\m02\d01",
                @"C:\images\m01\"
            };

            var reduction = new PathReductor();
            var output    = reduction.Reduce(input);

            Assert.AreEqual(3, output.Count);
        }