Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 3
0
 SkillResponse WhenAnIntentIsCaptured(AlexaController controller) => controller.Intent(DefaultSkillRequest);
Ejemplo n.º 4
0
 public AlexaControllerTests()
 {
     _controller = new AlexaController(Logger, Configuration, ParticipantsService, ParticipantsAuthenticationService.Object);
 }