public void ShouldReturnOk( [Frozen, Substitute] ICacheUtils cacheUtils, [Target] CacheController controller ) { var result = controller.ClearAll(); result.StatusCode.Should().Be((int)HttpStatusCode.OK); }
public void ShouldInvalidateAllUserTokens( [Frozen, Substitute] ICacheUtils cacheUtils, [Target] CacheController controller ) { controller.ClearAll(); cacheUtils.Received().InvalidateAllUserTokens(); }
public void ShouldInvalidateTheIdentityToken( [Frozen, Substitute] ICacheUtils cacheUtils, [Target] CacheController controller ) { controller.ClearAll(); cacheUtils.Received().InvalidatePrimaryToken(); }
public void ShouldRemoveAnyUserTokensForTheGivenIdentityId( Guid identityId, [Frozen, Substitute] ICacheUtils cacheUtils, [Target] CacheController controller ) { controller.ClearUserSpecificCache(identityId); cacheUtils.Received().InvalidateTokensForUser(Is(identityId.ToString())); }
/// <summary> /// Initializes a new instance of the <see cref="CacheController" /> class. /// </summary> /// <param name="userIdCache">Cache to control user IDs.</param> /// <param name="cacheUtils">Utilities for working with the identity cache.</param> /// <param name="commandsCache">Service for managing the Brighid Commands cache.</param> /// <param name="logger">Logger used to log info to some destination(s).</param> public CacheController( IUserIdCache userIdCache, ICacheUtils cacheUtils, IBrighidCommandsCache commandsCache, ILogger <CacheController> logger ) { this.userIdCache = userIdCache; this.cacheUtils = cacheUtils; this.commandsCache = commandsCache; this.logger = logger; }
public CachingBehavior(ILogger <CachingBehavior <TRequest, TResponse> > logger, ICacheUtils cacheUtils) { _logger = logger; _cacheUtils = cacheUtils; }