public async Task HandleShouldCallGetPricePredictionAsyncOnPoePricesInfoClient() { // arrange var cancellationToken = new CancellationToken(); const string league = "Heist"; var request = new GetPoePricesInfoPredictionQuery(this.validItem, new League { Id = league }); // act await this.handler.Handle(request, cancellationToken); // assert this.poePricesInfoClientMock.Verify(x => x.GetPricePredictionAsync(league, this.validItem.ItemText, cancellationToken)); }
public void Setup() { this.poePricesInfoClientMock = new Mock <IPoePricesInfoClient>(); this.cacheEntryMock = new Mock <ICacheEntry>(); this.memoryCacheMock = new Mock <IMemoryCache>(); this.memoryCacheMock.Setup(x => x.CreateEntry(It.IsAny <object>())) .Returns(this.cacheEntryMock.Object); this.handler = new GetPoePricesInfoPredictionQueryHandler( this.poePricesInfoClientMock.Object, this.memoryCacheMock.Object); this.validItem = new EquippableItem(ItemRarity.Rare) { ItemText = "abc" }; this.validRequest = new GetPoePricesInfoPredictionQuery(this.validItem, new League { Id = "Heist" }); }