Example #1
0
    public async Task querysessions_on_session_mgmt_service_should_use_ticket_store()
    {
        await _pipeline.LoginAsync("alice");

        _pipeline.RemoveLoginCookie();
        await _pipeline.LoginAsync("alice");

        _pipeline.RemoveLoginCookie();
        await _pipeline.LoginAsync("alice");

        _pipeline.RemoveLoginCookie();

        var sessions = await _sessionMgmt.QuerySessionsAsync(new SessionQuery { SubjectId = "alice" });

        var tickets = await _ticketService.QuerySessionsAsync(new SessionQuery { SubjectId = "alice" });

        tickets.ResultsToken.Should().Be(sessions.ResultsToken);
        tickets.HasPrevResults.Should().Be(sessions.HasPrevResults);
        tickets.HasNextResults.Should().Be(sessions.HasNextResults);
        tickets.TotalCount.Should().Be(sessions.TotalCount);
        tickets.TotalPages.Should().Be(sessions.TotalPages);
        tickets.CurrentPage.Should().Be(sessions.CurrentPage);

        tickets.Results.Select(x => x.SessionId).Should().BeEquivalentTo(sessions.Results.Select(x => x.SessionId));
    }
 public async Task OnGet()
 {
     UserSessions = await _sessionManagementService.QuerySessionsAsync(new SessionQuery
     {
         ResultsToken        = Token,
         RequestPriorResults = Prev == "true",
         DisplayName         = Filter,
         SessionId           = Filter,
         SubjectId           = Filter,
     });
 }