public void FirstTestName() { var route = new RouteNode <Uri>(new StubRoute <Uri>()); var joinNode = new JoinNode <Uri>(_id++, new ConstantNode <Uri>()); joinNode.Add(route); var alpha = new AlphaNode <Uri>(_id++); alpha.Add(joinNode); var equal = new EqualNode <Uri>(() => _id++); equal.Add("version", alpha); var segment = new SegmentNode <Uri>(1); segment.Add(equal); var engine = new MagnumRoutingEngine <Uri>(x => x); engine.Match <RootNode <Uri> >().Single().Add(segment); bool called = false; var uri = new Uri("http://localhost/version"); engine.Route(uri, x => { called = true; }); called.ShouldBeTrue(); }
public void FirstTestName() { var route = new RouteNode<Uri>(new StubRoute<Uri>()); var joinNode = new JoinNode<Uri>(_id++, new ConstantNode<Uri>()); joinNode.Add(route); var alpha = new AlphaNode<Uri>(_id++); alpha.Add(joinNode); var equal = new EqualNode<Uri>(() => _id++); equal.Add("version", alpha); var segment = new SegmentNode<Uri>(1); segment.Add(equal); var engine = new MagnumRoutingEngine<Uri>(x => x); engine.Match<RootNode<Uri>>().Single().Add(segment); bool called = false; var uri = new Uri("http://localhost/version"); engine.Route(uri, x => { called = true; }); called.ShouldBeTrue(); }
public RoutingEngineRoutingRunner() { _idGenerator = new SequentialNodeIdGenerator(); _engine = new MagnumRoutingEngine<Uri>(x => x); _segment = new SegmentNode<Uri>(1); _engine.Match<RootNode<Uri>>().Single().Add(_segment); _equal = new EqualNode<Uri>(() => _id++); _segment.Add(_equal); }
public void Given_an_existing_segment_condition() { _engine = new MagnumRoutingEngine<Uri>(x => x); var segmentNode = new SegmentNode<Uri>(1); var equals = new EqualNode<Uri>(() => _id++); equals.Add("version", new AlphaNode<Uri>(_id++)); segmentNode.Add(equals); _engine.Add(segmentNode); }
public RoutingEngineRoutingRunner() { _idGenerator = new SequentialNodeIdGenerator(); _engine = new MagnumRoutingEngine <Uri>(x => x); _segment = new SegmentNode <Uri>(1); _engine.Match <RootNode <Uri> >().Single().Add(_segment); _equal = new EqualNode <Uri>(() => _id++); _segment.Add(_equal); }
public void Given_an_existing_segment_condition() { _engine = new MagnumRoutingEngine <Uri>(x => x); var segmentNode = new SegmentNode <Uri>(1); var equals = new EqualNode <Uri>(() => _id++); equals.Add("version", new AlphaNode <Uri>(_id++)); segmentNode.Add(equals); _engine.Add(segmentNode); }