当前位置: 首页>>代码示例>>C#>>正文


C# Testing.BrowserResponse类代码示例

本文整理汇总了C#中Nancy.Testing.BrowserResponse的典型用法代码示例。如果您正苦于以下问题:C# BrowserResponse类的具体用法?C# BrowserResponse怎么用?C# BrowserResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BrowserResponse类属于Nancy.Testing命名空间,在下文中一共展示了BrowserResponse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FixtureSetup

 public void FixtureSetup()
 {
     var formsAuthenticationConfiguration = new FormsAuthenticationConfiguration()
         {
             RedirectUrl = "~/login",
             UserMapper = new FakeUserMapper(new UserService())
         };
     var configuration = A.Fake<IRazorConfiguration>();
     var bootstrapper = new ConfigurableBootstrapper(config =>
         {
             config.Module<UsersModule>();
             config.Module<LoginModule>();
             config.ViewEngine(new RazorViewEngine(configuration));
         });
     var bootstrapper2 = new ConfigurableBootstrapper(config =>
         {
             config.Module<UsersModule>();
             config.Module<LoginModule>();
             config.ViewEngine(new RazorViewEngine(configuration));
             config.RequestStartup((x, pipelines, z) => FormsAuthentication.Enable(pipelines, formsAuthenticationConfiguration));
         });
     _notLoggedInBrowser = new Browser(bootstrapper);
     _loggedInBrowserResponse = new Browser(bootstrapper2).Post("/login", x =>
         {
             x.HttpRequest();
             x.FormValue("Username", "Chris1");
             x.FormValue("Password", "123");
         });
 }
开发者ID:chrissie1,项目名称:NancyVB,代码行数:29,代码来源:TestUsersModule.cs

示例2: App

 public App(BrowserResponse response, FakeCommandSender commandSender = null)
 {
     if (commandSender != null)
     {
         Dispatched = new List<object>(commandSender.SentCommands).AsReadOnly();
     }
     Response = response;
 }
开发者ID:haf,项目名称:derp.inventory,代码行数:8,代码来源:App.cs

示例3: Observe

        public override void Observe()
        {
            base.RefreshDb();

            Container.Install(new BusInstaller(), new RepositoryInstaller(), new CommandInstaller());

            var state = StateMother.Draft;
            SaveAndFlush(state, StateMother.Published);



            var id = GetFromDb(state).Id;
            _browser = new Browser(with =>
            {
                with.Module(new StateModule(Container.Resolve<IPublishStorableCommands>(), Container.Resolve<IRepository<State>>()));
            });

            Session.FlushMode = FlushMode.Never;

            //Transaction(x =>
            //{
            _response = _browser.Post("/State/Edit", with =>
            {
                with.HttpRequest();
                with.Body("{ 'id': '" + id + "', 'name': 'Draft', 'alias': 'Test Draft'}");
                with.Header("content-type", "application/json");
                //with.Header("Authorization", "ApiKey 4E7106BA-16B6-44F2-AF4C-D1C411440F8E");
            });
            //});

            Session.Flush();
            // Session.Close();
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:33,代码来源:when_invoking_state_edit_route.cs

示例4: HomeModule

 public void HomeModule()
 {
     browser = new Browser (with => with.Module (new HomeModule ()));
     result = browser.Get ("/", with => {
         with.HttpRequest ();
     });
 }
开发者ID:chrlapointe,项目名称:yosethegame-dotnet-nancy,代码行数:7,代码来源:HomeTest.cs

示例5: SetUp

        public void SetUp()
        {
            _server = new Browser(new ServerBootstrapper());

            sampleConfig = TestHelper.GetSampleConfig();
            environmentConfig = TestHelper.GetEnvironmentOverrideConfig();

            setConfigResponse = _server.Post("application/new", context =>
            {
                context.HttpRequest();
                context.JsonBody(sampleConfig as object);
            });

            setEnvironmentConfigResponse = _server.Post("application/new", context =>
            {
                context.HttpRequest();
                context.JsonBody(environmentConfig as object);
                context.Query(TestHelper.Environment, "test");
            });

            getCreatedEnvironmentConfigResponse = _server.Get("application/new", context =>
            {
                context.Query(TestHelper.Environment, "test");
            });

            getEnvironmentConfigResult = getCreatedEnvironmentConfigResponse.Body.AsJson();
        }
开发者ID:cimdalli,项目名称:DynamicConfigurator,代码行数:27,代码来源:with_environment_data.cs

示例6: GetRootTests

 public GetRootTests()
 {
     _response = _browser.Get("/", with =>
     {
         with.HttpRequest();
     });
 }
开发者ID:nchabelengmc,项目名称:silverpop-dotnet-api,代码行数:7,代码来源:HomeModuleTests.cs

示例7: SetUp

        public void SetUp()
        {
            var bootstrapper = new AppBootstrapper();
            var browser = new Browser(bootstrapper);
            bootstrapper.Initialise();

            _result = browser.Get("/", with => with.HttpRequest());
        }
开发者ID:hauptmann,项目名称:GestUAB,代码行数:8,代码来源:When_requesting_root_page.cs

示例8: When_an_error_message_is_present

 public When_an_error_message_is_present()
 {
     _Browser = Testing.CreateBrowser<PagesModule>(with =>
     {
         with.Session(SessionKeys.FLASH_ERROR, "There was an error!");
     });
     _Response = _Browser.Get("/");
 }
开发者ID:nterry,项目名称:Apphbify,代码行数:8,代码来源:When_an_error_message_is_present.cs

示例9: When_user_is_logged_on

 public When_user_is_logged_on()
 {
     _Browser = Testing.CreateBrowser<PagesModule>(with =>
     {
         with.LoggedInUser();
     });
     _Response = _Browser.Get("/");
 }
开发者ID:nterry,项目名称:Apphbify,代码行数:8,代码来源:When_user_is_logged_on.cs

示例10: When_no_payload_is_sent

 public When_no_payload_is_sent()
 {
     _Browser = Testing.CreateBrowser<HookModule>();
     _Response = _Browser.Post("/Sites/foofoo/NotifyByEmail", with =>
     {
         with.Query("email", "[email protected]");
     });
 }
开发者ID:nterry,项目名称:Apphbify,代码行数:8,代码来源:When_no_payload_is_sent.cs

示例11: When_deploying_an_app_that_doesnt_exist

 public When_deploying_an_app_that_doesnt_exist()
 {
     _Browser = Testing.CreateBrowser<SecuredPagesModule>(with =>
     {
         with.LoggedInUser();
     });
     _Response = _Browser.Post("/Deploy/foofoo");
 }
开发者ID:nterry,项目名称:Apphbify,代码行数:8,代码来源:When_deploying_an_app_that_doesnt_exist.cs

示例12: When_displaying_the_deploy_page

 public When_displaying_the_deploy_page()
 {
     _Browser = Testing.CreateBrowser<SecuredPagesModule>(with =>
     {
         with.LoggedInUser();
     });
     _Response = _Browser.Get("/Deploy/jabbr");
 }
开发者ID:nterry,项目名称:Apphbify,代码行数:8,代码来源:When_displaying_the_deploy_page.cs

示例13: When_user_signs_out

 public When_user_signs_out()
 {
     _Browser = Testing.CreateBrowser<OAuthModule>(with =>
     {
         with.LoggedInUser();
     });
     _Response = _Browser.Get("/SignOut");
 }
开发者ID:nterry,项目名称:Apphbify,代码行数:8,代码来源:When_user_signs_out.cs

示例14: When_a_success_message_is_present

 public When_a_success_message_is_present()
 {
     _Browser = Testing.CreateBrowser<PagesModule>(with =>
     {
         with.Session(SessionKeys.FLASH_SUCCESS, "All done!");
     });
     _Response = _Browser.Get("/");
 }
开发者ID:nterry,项目名称:Apphbify,代码行数:8,代码来源:When_a_success_message_is_present.cs

示例15: when_posting_a_new_idea

 public when_posting_a_new_idea()
 {
     mockUsersRepo.Setup(d => d.GetUserFromIdentifier(user.Id)).Returns(user);
     response = browser.Post("/api/ideas", with => {
         with.JsonBody(new { title = "Test" });
         with.LoggedInUser(user);
     });
 }
开发者ID:vkoppaka,项目名称:Ideastrike,代码行数:8,代码来源:when_posting_a_new_idea.cs


注:本文中的Nancy.Testing.BrowserResponse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。