Exemplo n.º 1
0
        public void ON_ConvertPathToEdgeData_WHEN_Path_Does_Not_Exist_SHOULD_Throw_Exception()
        {
            // Arrange
            var uut = new SymbolGraph <string, string>(40, StringComparer.InvariantCultureIgnoreCase);

            TestEdgesFactory.Define(uut, v => v.Source + v.Destination,
                                    TestEdgesFactory.DefinitionSet.PathA2J | TestEdgesFactory.DefinitionSet.JA);

            uut.Freeze();

            // Act
            var _ = uut.ConvertPathToEdgeData("ADJF".AsStrings()).ToArray();
            // Assert handled by expected exception.
        }
Exemplo n.º 2
0
        public void ON_ConvertPathToEdgeData_WHEN_Path_Exists_SHOULD_Return_Path_Edge_Data()
        {
            // Arrange
            var uut = new SymbolGraph <string, string>(40, StringComparer.InvariantCultureIgnoreCase);

            TestEdgesFactory.Define(uut, v => v.Source + v.Destination,
                                    TestEdgesFactory.DefinitionSet.PathA2J | TestEdgesFactory.DefinitionSet.JA);

            uut.Freeze();

            // Act
            var edges = uut.ConvertPathToEdgeData("ABCD".AsStrings()).ToArray();

            // Assert
            CollectionAssert.AreEqual(EnumerableExtensions.Enumerate("AB", "BC", "CD").ToArray(), edges.ToArray());
        }