BrickPile.Tests.Infrastructure.Listeners.StoreListenerTests.BeforeStore.SetupContext C# (CSharp) Method

SetupContext() private method

private SetupContext ( ) : IDocumentStore
return IDocumentStore
            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>(() => (IDocumentStore)store));
                bootStrapper.Initialise();

                HttpContext.Current = new HttpContext(new HttpRequest(null, "http://tempuri.org", null), new HttpResponse(null))
                {
                    User = A.Fake<IPrincipal>()
                };
                return store;
            }