public TypeOneRouteNetworkTests(TypeOneTestNetworkContainerFixture fixture) { container = fixture; var routeNetworkState = container.ServiceProvider.GetService <IRouteNetworkState>(); _testRouteNetwork = new TestRouteNetworkType1(container.CommandBus, routeNetworkState); }
public EditingTests(EditingContainerFixture fixture) { container = fixture; var routeNetworkState = container.ServiceProvider.GetService <IRouteNetworkState>(); var testRouteNetwork = new TestRouteNetworkType1(container.CommandBus, routeNetworkState); }
public InterestTests(InterestContainerFixture interestContainerFixture) { container = interestContainerFixture; var routeNetworkState = container.ServiceProvider.GetService <IRouteNetworkState>(); var testRouteNetwork = new TestRouteNetworkType1(container.CommandBus, routeNetworkState); // Create a little network for testing // // cabinet1 ---- sdu1 // |-- junction1 -- sdu2 var fixture = new Fixture(); // Cabinet 1 var cabinet1Cmd = fixture.Build <AddNodeCommand>() .With(x => x.Name, "cabinet 1") .With(x => x.Geometry, new Geometry("Point", "[10, 10]")) .With(x => x.NodeKind, RouteNodeKindEnum.CabinetSmall) .With(x => x.NodeFunctionKind, RouteNodeFunctionKindEnum.SplicePoint) .Create(); container.CommandBus.Send(cabinet1Cmd).Wait(); testCabinet1 = cabinet1Cmd.Id; // SDU 1 var sdu1cmd = fixture.Build <AddNodeCommand>() .With(x => x.Name, "sdu 1") .With(x => x.Geometry, new Geometry("Point", "[10, 11]")) .With(x => x.NodeKind, RouteNodeKindEnum.SingleDwellingUnit) .With(x => x.NodeFunctionKind, RouteNodeFunctionKindEnum.ServiceDeliveryPoint) .Create(); container.CommandBus.Send(sdu1cmd).Wait(); testSdu1 = sdu1cmd.Id; // Junction 1 var junction1cmd = fixture.Build <AddNodeCommand>() .With(x => x.Name, "junction 1") .With(x => x.Geometry, new Geometry("Point", "[11, 10]")) .With(x => x.NodeKind, RouteNodeKindEnum.ConduitClosure) .With(x => x.NodeFunctionKind, RouteNodeFunctionKindEnum.BurriedConduitPont) .Create(); container.CommandBus.Send(junction1cmd).Wait(); testJunction1 = junction1cmd.Id; // SDU 2 var sdu2cmd = fixture.Build <AddNodeCommand>() .With(x => x.Name, "sdu 2") .With(x => x.Geometry, new Geometry("Point", "[12, 10]")) .With(x => x.NodeKind, RouteNodeKindEnum.SingleDwellingUnit) .With(x => x.NodeFunctionKind, RouteNodeFunctionKindEnum.ServiceDeliveryPoint) .Create(); container.CommandBus.Send(sdu2cmd).Wait(); testSdu2 = sdu2cmd.Id; // Add segment between cabinet 1 and sdu 1 var addSegment1Cmd = fixture.Build <AddSegmentCommand>() .With(x => x.FromNodeId, cabinet1Cmd.Id) .With(x => x.ToNodeId, sdu1cmd.Id) .With(x => x.Geometry, new Geometry("LineString", "[[10,10],[10, 11]]")) .With(x => x.SegmentKind, RouteSegmentKindEnum.Underground) .Create(); container.CommandBus.Send(addSegment1Cmd).Wait(); testCabinet1ToSdu1 = addSegment1Cmd.Id; // Add segment between cabinet 1 and junction 1 var addSegment2Cmd = fixture.Build <AddSegmentCommand>() .With(x => x.FromNodeId, cabinet1Cmd.Id) .With(x => x.ToNodeId, junction1cmd.Id) .With(x => x.Geometry, new Geometry("LineString", "[[10,10],[11, 10]]")) .With(x => x.SegmentKind, RouteSegmentKindEnum.Underground) .Create(); container.CommandBus.Send(addSegment2Cmd).Wait(); testCabinet1ToJunction1 = addSegment2Cmd.Id; // Add segment between junction 1 and sdu 2 var addSegment3Cmd = fixture.Build <AddSegmentCommand>() .With(x => x.FromNodeId, junction1cmd.Id) .With(x => x.ToNodeId, sdu2cmd.Id) .With(x => x.Geometry, new Geometry("LineString", "[[11,10],[12, 10]]")) .With(x => x.SegmentKind, RouteSegmentKindEnum.Underground) .Create(); container.CommandBus.Send(addSegment3Cmd).Wait(); testJunction1ToSdu2 = addSegment3Cmd.Id; }