public async Task TestMultipleConvertibleQuotes() { var Quotes = Enumerable.Range(0, 2).Select(x => new Quote() { ApprovedAt = 1 }).ToList(); var mockJobberClient = MockJobberClientBuilder.Create() .ReturnsQuotesAsync(Quotes) .Build(); var fulfillmentRequest = FulfillmentRequestBuilder.Create(Constants.Intents.ConvertibleQuotes) .Build(); var fulfiller = new ConvertibleQuoteIntentFulfiller(); var response = await fulfiller.FulfillAsync(fulfillmentRequest, mockJobberClient.Object); response.AssertResponseSpeech("There are 2 quotes ready to be converted into jobs."); }
public async Task TestSingleConvertibleQuotes() { var Quotes = Enumerable.Range(0, 1).Select(x => new Quote() { ApprovedAt = 1, Client = new Client() { Name = "John Doe" } }).ToList(); var mockJobberClient = MockJobberClientBuilder.Create() .ReturnsQuotesAsync(Quotes) .Build(); var fulfillmentRequest = FulfillmentRequestBuilder.Create(Constants.Intents.ConvertibleQuotes) .Build(); var fulfiller = new ConvertibleQuoteIntentFulfiller(); var response = await fulfiller.FulfillAsync(fulfillmentRequest, mockJobberClient.Object); response.AssertResponseSpeech("You have one quote that can be converted for John Doe."); }