Esempio n. 1
0
            public void ShouldClearTheCommandsCache(
                [Frozen, Substitute] IBrighidCommandsCache commandsCache,
                [Target] CacheController controller
                )
            {
                controller.ClearAll();

                commandsCache.Received().ClearAllParameters();
            }
Esempio n. 2
0
            public void ShouldClearCommandParameters(
                string name,
                [Frozen, Substitute] IBrighidCommandsCache commandsCache,
                [Target] CacheController controller
                )
            {
                controller.ClearCommandSpecificCache(name);

                commandsCache.Received().ClearParameters(Is(name));
            }
 /// <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;
 }