Exemple #1
0
        public void OrderedJunctionBoxes_NullArraySouldThrows_ArgumentException()
        {
            var junctionBoxesSorter = new JunctionBoxesMultiThread();

            string[] boxList = null;

            Assert.Throws <ArgumentException>(() => junctionBoxesSorter.OrderedJunctionBoxes(boxList));
        }
Exemple #2
0
        public void OrderedJunctionBoxes_BasicCase()
        {
            var junctionBoxesSorter = new JunctionBoxesMultiThread();
            var boxList             = new string[0];
            var sorted = junctionBoxesSorter.OrderedJunctionBoxes(boxList);

            var expected = new List <string>();

            Assert.Equal(expected, sorted);
        }
Exemple #3
0
        public void OrderedJunctionBoxes_OneJunctionBox_ShouldReturnSame()
        {
            var junctionBoxesSorter = new JunctionBoxesMultiThread();
            var boxList             = new[] { "r1 box ape bit" };
            var sorted = junctionBoxesSorter.OrderedJunctionBoxes(boxList);

            var expected = new List <string>()
            {
                "r1 box ape bit"
            };

            Assert.Equal(expected, sorted);
        }
Exemple #4
0
        public void OrderedJunctionBoxes_UnexpectedFormat_ShouldReturnFormattedFirst()
        {
            var junctionBoxesSorter = new JunctionBoxesMultiThread();
            var boxList             = new[] { "dog -0", "cat​​ -0" };

            var sorted = junctionBoxesSorter.OrderedJunctionBoxes(boxList);

            var expected = new List <string> {
                "dog -0", "cat​​ -0"
            };

            Assert.Equal(expected, sorted);
        }
Exemple #5
0
        public void OrderedJunctionBoxes_TwoOldJunctionBox_ShouldReturnSorted()
        {
            var junctionBoxesSorter = new JunctionBoxesMultiThread();
            var boxList             = new[] { "b4 xi me nu", "br8 eat nim did" };

            var sorted = junctionBoxesSorter.OrderedJunctionBoxes(boxList);

            var expected = new List <string>()
            {
                "br8 eat nim did", "b4 xi me nu"
            };

            Assert.Equal(expected, sorted);
        }
Exemple #6
0
        public void OrderedJunctionBoxes_OneNewAndOneOld_ShouldReturnOldFirst()
        {
            var junctionBoxesSorter = new JunctionBoxesMultiThread();

            var boxList = new[] { "b4 xi me nu", "t2 13 121 98" };

            var sorted = junctionBoxesSorter.OrderedJunctionBoxes(boxList);

            var expected = new List <string>()
            {
                "b4 xi me nu", "t2 13 121 98"
            };

            Assert.Equal(expected, sorted);
        }
Exemple #7
0
        public void OrderedJunctionBoxes_TwoNewJunctionBox_ShouldReturnAsItCome()
        {
            var junctionBoxesSorter = new JunctionBoxesMultiThread();

            var boxList = new[] { "t2 13 121 98", "f3 52 54 31" };

            var sorted = junctionBoxesSorter.OrderedJunctionBoxes(boxList);

            var expected = new List <string>()
            {
                "t2 13 121 98", "f3 52 54 31"
            };

            Assert.Equal(expected, sorted);
        }