public async Task TestNoSendableInvoices() { var mockJobberClient = MockJobberClientBuilder.Create() .ReturnsDraftInvoices(new List <Invoice>()) .Build(); var fulfillmentRequest = FulfillmentRequestBuilder.Create(Constants.Intents.SendableInvoices) .Build(); var fulfiller = new SendableInvoicesIntentFulfiller(); var response = await fulfiller.FulfillAsync(fulfillmentRequest, mockJobberClient.Object); response.AssertResponseSpeech("Looks like you have no invoices that need to be sent!"); }
public async Task TestMultipleSendableInvoices() { var Invoices = Enumerable.Range(0, 2).Select(x => new Invoice()).ToList(); var mockJobberClient = MockJobberClientBuilder.Create() .ReturnsDraftInvoices(Invoices) .Build(); var fulfillmentRequest = FulfillmentRequestBuilder.Create(Constants.Intents.SendableInvoices) .Build(); var fulfiller = new SendableInvoicesIntentFulfiller(); var response = await fulfiller.FulfillAsync(fulfillmentRequest, mockJobberClient.Object); response.AssertResponseSpeech("There are 2 invoices ready to be sent."); }