Exemple #1
0
 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);
 }
Exemple #2
0
 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());
 }
Exemple #3
0
 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);
 }
Exemple #4
0
 protected void Setup() => SUT = new ConcreteAsyncCachedQuery(The <IAsyncCachedQueryStub>());
Exemple #5
0
 public override void Setup() => SUT = new ConcreteAsyncCachedQuery(The <IAsyncCachedQueryStub>());