public override void Setup() { SUT = new ConcreteAsyncCachedQuery(The <IAsyncCachedQueryStub>()); The <IAsyncCachedQueryStub>().When(x => x.CacheKey(Arg.Any <ICache>())).Do(x => x.ArgAt <ICache>(0).VaryBy = nameof(ICache.VaryBy)); ExpectedCacheKey = $"{SUT.GetType().FullName}_{nameof(ICache.VaryBy)}"; The <IAsyncCachedQueryStub>().CacheEntryOptions(QueryContext).Returns(CacheEntryOptions); }
public override void Setup() { SUT = new ConcreteAsyncCachedQuery(The <IAsyncCachedQueryStub>()); The <IAsyncCachedQueryStub>().When(x => x.CacheKey(Arg.Any <ICache>())).Do(x => x.ArgAt <ICache>(0).VaryBy = Guid.NewGuid().ToString()); The <IAsyncCachedQueryStub>().CacheEntryOptions(_queryContext).Returns(x => new CacheEntryOptions()); The <IAsyncCachedQueryStub>().Query(_queryContext, CancellationToken.None).Returns(x => new QueryResult()); }
protected virtual void Setup() { SUT = new ConcreteAsyncCachedQuery(The <IAsyncCachedQueryStub>()); The <IDecorator>().Decorate(Arg.Any <object>(), Arg.Any <Func <Task <QueryResult> > >()).Returns(x => x.ArgAt <Func <Task <QueryResult> > >(1).Invoke()); The <IAsyncCachedQueryStub>().QueryAsync(QueryContext).Returns(QueryResult); }
protected void Setup() => SUT = new ConcreteAsyncCachedQuery(The <IAsyncCachedQueryStub>());
public override void Setup() => SUT = new ConcreteAsyncCachedQuery(The <IAsyncCachedQueryStub>());