コード例 #1
0
ファイル: ProgramTests.cs プロジェクト: coenm/Treatment
        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;
        }
コード例 #2
0
            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);
            }
コード例 #3
0
            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();
 }
コード例 #5
0
 public DefaultNancyBootstrapperBootstrapperBaseFixture()
 {
     this.bootstrapper = new FakeBootstrapper(this.Configuration);
 }
コード例 #6
0
ファイル: BootstrapperTests.cs プロジェクト: zfq308/Crest
 public void SetUp()
 {
     this.bootstrapper = new FakeBootstrapper();
     this.bootstrapper.DiscoveryService.GetDiscoveredTypes()
     .Returns(new[] { typeof(IFakeInterface), typeof(FakeClass) });
 }