public ProgramTests() { console = new FakeConsoleAdapter(); bootstrapper = new FakeBootstrapper(); bootstrapper.RegisterPostRegisterAction(container => container.RegisterInstance <IConsole>(console)); /* * _bootstrapper.RegisterPostRegisterAction(container => container.RegisterInstance<IFileSystem>(_console)); * container.RegisterInstance<IFileSystem>(OsFileSystem.Instance); */ sb = new StringBuilder(); Console.SetOut(new StringWriter(sb)); Console.SetError(new StringWriter(sb)); Program.Bootstrapper = bootstrapper; }
private IDocumentStore SetupContext() { HttpContext.Current = null; RouteTable.Routes.Clear(); var store = NewDocumentStore(); var bootStrapper = new FakeBootstrapper(); var field = typeof(DefaultBrickPileBootstrapper).GetField("DocStore", BindingFlags.Static | BindingFlags.NonPublic); field.SetValue(null, new Lazy <IDocumentStore>(() => store)); bootStrapper.Initialise(); HttpContext.Current = new HttpContext(new HttpRequest(null, "http://tempuri.org", null), new HttpResponse(null)) { User = A.Fake <IPrincipal>() }; return(store); }
private IDocumentStore SetupContext() { HttpContext.Current = null; RouteTable.Routes.Clear(); var store = NewDocumentStore(); var bootStrapper = new FakeBootstrapper(); var field = typeof(DefaultBrickPileBootstrapper).GetField("DocStore", BindingFlags.Static | BindingFlags.NonPublic); field.SetValue(null, new Lazy<IDocumentStore>(() => store)); bootStrapper.Initialise(); HttpContext.Current = new HttpContext(new HttpRequest(null, "http://tempuri.org", null), new HttpResponse(null)) { User = A.Fake<IPrincipal>() }; return store; }
public NancyBootstrapperWithRequestContainerBaseFixture() { this.bootstrapper = new FakeBootstrapper(); }
public DefaultNancyBootstrapperBootstrapperBaseFixture() { this.bootstrapper = new FakeBootstrapper(this.Configuration); }
public void SetUp() { this.bootstrapper = new FakeBootstrapper(); this.bootstrapper.DiscoveryService.GetDiscoveredTypes() .Returns(new[] { typeof(IFakeInterface), typeof(FakeClass) }); }