コード例 #1
0
        public void Find_WhenStartEqualsStop_ReturnsEmptyRoute()
        {
            var graph = CreateFacetsGraphByFakeContext(FacetContext);

            GraphRoute route = graph.Find("tbl_locations", "tbl_locations");

            Assert.NotNull(route);
            Assert.Empty(route.Items);
        }
コード例 #2
0
        public GraphRoute FakeRoute(string[] nodePairs)
        {
            var graphRoute = new GraphRoute(
                nodePairs.Select(x => x.Split("/"))
                .Select(z => new { Source = z[0], Target = z[1] })
                .Select(z => FakeTableRelation(z.Source, z.Target))
                );

            return(graphRoute);
        }
コード例 #3
0
        private GraphRoute CreateGraphRoute()
        {
            GraphRoute testRoute = new GraphRoute(
                new List <TableRelation>()
            {
                FacetsGraph.EdgeContaniner.GetEdge("A", "B"),
                FacetsGraph.EdgeContaniner.GetEdge("B", "F"),
                FacetsGraph.EdgeContaniner.GetEdge("F", "H")
            }
                );

            return(testRoute);
        }
コード例 #4
0
 public void Find_WhenStartAndStopsAreNeighbours_IsSingleStep()
 {
     using (var container = CreateDependencyContainer())
         using (var scope = container.BeginLifetimeScope()) {
             // Arrange
             var graph = scope.Resolve <IFacetsGraph>();
             // Act
             GraphRoute route = graph.Find("tbl_locations", "tbl_site_locations");
             // Assert
             Assert.NotNull(route);
             Assert.Single(route.Items);
             Assert.Equal("tbl_locations", route.Items[0].SourceName);
             Assert.Equal("tbl_site_locations", route.Items[0].TargetName);
         }
 }