Exemplo n.º 1
0
        public async Task TestNoUnassignedVisits()
        {
            var mockJobberClient = MockJobberClientBuilder.Create()
                                   .ReturnsVisitsForToday(new List <Visit>())
                                   .Build();

            var fulfillmentRequest = FulfillmentRequestBuilder.Create(Constants.Intents.UnassignedVisits)
                                     .Build();

            var fulfiller = new UnassignedVisitsIntentFulfiller();
            var response  = await fulfiller.FulfillAsync(fulfillmentRequest, mockJobberClient.Object);

            response.AssertResponseSpeech("There are no visits left to be assigned today!");
        }
Exemplo n.º 2
0
        public async Task TestMultipleUnassignedVisits()
        {
            var Visits = Enumerable.Range(0, 2).Select(x => new Visit()
            {
                AssignedTo = new List <Assigned>()
            }).ToList();

            var mockJobberClient = MockJobberClientBuilder.Create()
                                   .ReturnsVisitsForToday(Visits)
                                   .Build();

            var fulfillmentRequest = FulfillmentRequestBuilder.Create(Constants.Intents.UnassignedVisits)
                                     .Build();

            var fulfiller = new UnassignedVisitsIntentFulfiller();
            var response  = await fulfiller.FulfillAsync(fulfillmentRequest, mockJobberClient.Object);

            response.AssertResponseSpeech("You have 2 unassigned visits for today.");
        }