Example #1
0
        public void TopologicalOrderedStrings_Returns_KO()
        {
            // Arrange
            IO.Reader = new StreamReader(AppDomain.CurrentDomain.BaseDirectory + "/IOFiles/TopologicalOrderedStringsInput2.txt");
            var ns   = IO.ReadIntArray();
            int n    = ns[0];
            int m    = ns[1];
            var strs = IO.ReadStringMatrix(m);

            // Act
            var result = TopologicalOrderedStrings.GetTopologicalOrder(strs, n);

            // Assert
            Assert.AreEqual("KO", result);
        }
Example #2
0
        public void TopologicalOrderedStrings_Returns_One_Possible_Topological_Sorting_Strings()
        {
            // Arrange
            IO.Reader = new StreamReader(AppDomain.CurrentDomain.BaseDirectory + "/IOFiles/TopologicalOrderedStringsInput1.txt");
            var ns   = IO.ReadIntArray();
            int n    = ns[0];
            int m    = ns[1];
            var strs = IO.ReadStringMatrix(m);

            // Act
            var result = TopologicalOrderedStrings.GetTopologicalOrder(strs, n);

            // Assert
            Assert.AreEqual("fraise mojito club-mate pamplemousse grenadine", result);
        }