public async Task ShouldGetProviderResultById() { string providerResultId = new RandomString(); string partitionKey = new RandomString(); ProviderResultDataKey providerResultDataKey = new ProviderResultDataKey(providerResultId, partitionKey); ProviderResult expectedProviderResult = new ProviderResult() { Id = providerResultId }; _repository.GetProviderResultById(Arg.Is(providerResultId), Arg.Is(partitionKey)) .Returns(expectedProviderResult); ProviderResult providerResult = await _reader.GetData(providerResultDataKey); providerResult .Should() .Be(expectedProviderResult); await _repository .Received(1) .GetProviderResultById(Arg.Is(providerResultId), Arg.Is(partitionKey)); }
public async Task <ProviderResult> GetData(ProviderResultDataKey key) { return(await _calculationResultsRepository.GetProviderResultById(key.ProviderResultId, key.PartitionKey)); }