public void Initialize(string basePath = null)
        {
            var builder = new WebHostBuilder();

            builder.ConfigureServices(ConfigureServices);
            builder.Configure(app =>
            {
                if (basePath != null)
                {
                    app.Map(basePath, map =>
                    {
                        ConfigureApp(map);
                    });
                }
                else
                {
                    ConfigureApp(app);
                }
            });
            var server = new TestServer(builder);

            Server  = new TestServer(builder);
            Handler = Server.CreateHandler();

            BrowserClient = new BrowserClient(new BrowserHandler(Handler));
            Client        = new HttpClient(Handler);
        }
        public void Initialize()
        {
            Server  = TestServer.Create(null, Configure, ConfigureServices);
            Handler = Server.CreateHandler();

            BrowserClient = new BrowserClient(new BrowserHandler(Handler));
            Client        = new HttpClient(Handler);
        }
        public void Initialize()
        {
            Server = TestServer.Create(null, Configure, ConfigureServices);
            Handler = Server.CreateHandler();

            BrowserClient = new BrowserClient(new BrowserHandler(Handler));
            Client = new HttpClient(Handler);
        }
Exemple #4
0
        /* helpers */
        public async Task LoginAsync(ClaimsPrincipal subject)
        {
            var old = BrowserClient.AllowAutoRedirect;

            BrowserClient.AllowAutoRedirect = false;

            Subject = subject;
            await BrowserClient.GetAsync(LoginPage);

            BrowserClient.AllowAutoRedirect = old;
        }
Exemple #5
0
        public void Initialize()
        {
            var builder = new WebHostBuilder()
                          .ConfigureServices(ConfigureServices)
                          .Configure(Configure);
            var server = new TestServer(builder);

            Server  = new TestServer(builder);
            Handler = Server.CreateHandler();

            BrowserClient = new BrowserClient(new BrowserHandler(Handler));
            Client        = new HttpClient(Handler);
        }
        public void Initialize()
        {
            var builder = new WebHostBuilder()
                .ConfigureServices(ConfigureServices)
                .Configure(Configure);
            var server = new TestServer(builder);

            Server = new TestServer(builder);
            Handler = Server.CreateHandler();

            BrowserClient = new BrowserClient(new BrowserHandler(Handler));
            Client = new HttpClient(Handler);
        }