/* helpers */
        public async Task LoginAsync(ClaimsPrincipal subject)
        {
            var old = BrowserClient.AllowAutoRedirect;

            BrowserClient.AllowAutoRedirect = false;

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

            BrowserClient.AllowAutoRedirect = old;
        }
        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);
        }