public FakeUsersService(ISessionState sessionState)
 {
     _sessionState = sessionState;
     _actualUsers = _sessionState.Get<IList<UserTasksModel>>();
     if (_actualUsers == null)
     {
         _actualUsers = CreateUsers().ToList();
         Update(null);
     }
 }
Example #2
0
        public async Task Execute()
        {
            var token  = _sessionState.Get <string>("auth:token");
            var result = await _fluentHttpClient.Patch <KeepAliveResponse>("/api/auth/keep-alive", token);

            Check.That(result).IsNotNull();
            Check.That(result.AccessToken).IsNotNull();

            _logger.LogInformation("[{service}] complete", nameof(Auth_KeepAliveTest));
        }
Example #3
0
 /// <summary>
 /// Gets state data stored with the specified key.
 /// </summary>
 /// <typeparam name="T">The type of data to retrieve.</typeparam>
 /// <param name="key">An object representing the unique key with which the data was stored.</param>
 /// <returns>An instance of <typeparamref name="T"/> or null if not found.</returns>
 public T Get <T>(object key)
 {
     return(_state.Get <T>(key));
 }
Example #4
0
 public static T Get <T>(this ISessionState sessionState, string key) where T : class
 {
     return(sessionState.Get(key) as T);
 }