public void ExpectOriginalDispatchContextRemainsUnmodifiedWhenOverridden(RouteRegistrar registrar, Guid token)
        {
            var module  = new StubModule();
            var factory = MockRepository.GenerateMock <Func <Type, object> >();

            registrar
            .WithDispatchContext(x => x.WithServiceFactory(factory))
            .RegisterServiceInto(module, typeof(StubService));

            var anotherModule = new StubModule();

            registrar.RegisterServiceInto(anotherModule, typeof(StubService));

            new Browser(with => with.Module(anotherModule)).Get <object>("/whatever");
            factory.AssertWasNotCalled(x => x(Arg <Type> .Is.Anything));
        }
		public AsyncCancelModule(RouteRegistrar registrar)
		{
			registrar.RegisterServiceInto(this, typeof(AsyncCancelService));
		}
		public void ExpectOriginalDispatchContextRemainsUnmodifiedWhenOverridden(RouteRegistrar registrar, Guid token)
		{
			var module = new StubModule();
			var factory = MockRepository.GenerateMock<Func<Type, object>>();

			registrar
				.WithDispatchContext(x => x.WithServiceFactory(factory))
				.RegisterServiceInto(module, typeof(StubService));

			var anotherModule = new StubModule();
			registrar.RegisterServiceInto(anotherModule, typeof(StubService));

			new Browser(with => with.Module(anotherModule)).Get<object>("/whatever");
			factory.AssertWasNotCalled(x => x(Arg<Type>.Is.Anything));
		}
		public NamedRouteModule(RouteRegistrar registrar)
		{
			registrar.RegisterServiceInto(this, typeof(NamedRouteService));
		}
		public AsyncEchoModule(RouteRegistrar registrar)
		{
			registrar.RegisterServiceInto(this, typeof(AsyncEchoService));
		}
 public NamedRouteModule(RouteRegistrar registrar)
 {
     registrar.RegisterServiceInto(this, typeof(NamedRouteService));
 }
 public EchoModule(RouteRegistrar registrar)
 {
     registrar.RegisterServiceInto(this, typeof(EchoService));
 }
Exemple #8
0
 public AsyncCancelModule(RouteRegistrar registrar)
 {
     registrar.RegisterServiceInto(this, typeof(AsyncCancelService));
 }