public async Task Should_be_valid_when_job_is_requested_to_clear_cache_and_cache_is_empty() { _updateCacheJob = new UpdateCacheJob(_cache, _mockPortfolio.Object); await _updateCacheJob.ClearAsync(); _cache.Get(CacheKeys.Portfolio).Should().BeNull(); }
public async Task Should_be_valid_when_job_is_requested_to_update_cache_and_cache_is_not_empty() { _cache.Set(CacheKeys.Portfolio, Array.Empty <byte>()); _updateCacheJob = new UpdateCacheJob(_cache, _mockPortfolio.Object); _mockPortfolio.Setup(x => x.GetAsync()).ReturnsAsync(InvestmentsResponse); await _updateCacheJob.UpdateAsync(); _cache.Get(CacheKeys.Portfolio).Should().NotBeNull(); }
public async Task Should_be_valid_when_job_is_requested_to_clear_cache() { await _cache.SetAsync(CacheKeys.Portfolio, Array.Empty <byte>()); _updateCacheJob = new UpdateCacheJob(_cache, _mockPortfolio.Object); await _updateCacheJob.ClearAsync(); _cache.Get(CacheKeys.Portfolio).Should().BeNull(); }