public void SetUp() { theHttpRequest = new StandInCurrentHttpRequest(); UrlContext.Stub("http://server"); theUrlResolver = new ChainUrlResolver(theHttpRequest); theGraph = BehaviorGraph.BuildFrom(registry => { registry.Actions.IncludeType<ChainUrlResolverEndpoint>(); }); theSimpleChain = theGraph.BehaviorFor<ChainUrlResolverEndpoint>(x => x.get_index()); theChainWithRouteParams = theGraph.BehaviorFor(typeof(ChainUrlParams)); }
public void can_inject_arguments_into_the_behavior_factory() { var standInCurrentHttpRequest = new StandInCurrentHttpRequest(); var inMemoryFubuRequest = new InMemoryFubuRequest(); var arguments = new ServiceArguments() .With<ICurrentHttpRequest>(standInCurrentHttpRequest) .With<IFubuRequest>(inMemoryFubuRequest); var behavior = ContainerFacilitySource .BuildBehavior(arguments, ObjectDef.ForType<GuyWhoNeedsRequest>(), x => { }) .As<GuyWhoNeedsRequest>(); behavior.Http.ShouldBeTheSameAs(standInCurrentHttpRequest); behavior.Request.ShouldBeTheSameAs(inMemoryFubuRequest); }
public void SetUp() { theRequest = new StandInCurrentHttpRequest(); }