public void Getjsone() { // Arrange var controller = new AlexaController(); controller.Request = new HttpRequestMessage(); controller.Configuration = new HttpConfiguration(); // Act StreamReader file = new StreamReader(@"Controllers\Payload\GetMileage.json"); var clas = JsonConvert.DeserializeObject <Json.SpeechletRequestEnvelope>(file.ReadToEnd()); // Assert Assert.IsNotNull(clas); }
public void WordOfTheDayTest() { // arrange AlexaRequestPayload alexaRequestPayload = new AlexaRequestPayload(); var alexaRequestService = new Mock <IAlexaRequestService>(); alexaRequestService.Setup(s => s.ProcessAlexaRequest(alexaRequestPayload)).Returns(new AlexaResponse("hello")); AlexaController controller = new AlexaController(alexaRequestService.Object); // act AlexaResponse result = controller.WordOfTheDay(alexaRequestPayload); // assert Assert.AreEqual(result.Response.OutputSpeech.Text, "hello"); }
SkillResponse WhenAnIntentIsCaptured(AlexaController controller) => controller.Intent(DefaultSkillRequest);
public AlexaControllerTests() { _controller = new AlexaController(Logger, Configuration, ParticipantsService, ParticipantsAuthenticationService.Object); }