Ejemplo n.º 1
0
        public void IsValid_ReturnsTrue_WhenSkillRequestIsValid()
        {
            SkillRequest skillRequest = new SkillRequest()
            {
                Context = new Context()
                {
                    System = new AlexaSystem()
                    {
                        ApiEndpoint    = "http://localhost",
                        ApiAccessToken = "TestApiAccessToken",
                        User           = new User()
                        {
                            UserId      = "TestUserId",
                            AccessToken = "TestAccessToken"
                        }
                    }
                },
                Request = new IntentRequest()
                {
                    RequestId = "TestRequestId",
                    Type      = "IntentRequest",
                    Locale    = "en-US"
                }
            };

            SkillRequestValidator sut = new SkillRequestValidator();

            Assert.True(sut.IsValid(skillRequest));
        }
Ejemplo n.º 2
0
        public void IsValid_ReturnsFalse_WhenSkillRequestIsInValid_MissingUser()
        {
            SkillRequest skillRequest = new SkillRequest()
            {
                Context = new Context()
                {
                    System = new AlexaSystem()
                    {
                        ApiEndpoint    = "TestApiEndpoint",
                        ApiAccessToken = "TestApiAccessToken"
                    }
                },
                Request = new IntentRequest()
                {
                    RequestId = "TestRequestId",
                    Type      = "IntentRequest"
                }
            };

            SkillRequestValidator sut = new SkillRequestValidator();

            Assert.False(sut.IsValid(skillRequest));
        }
Ejemplo n.º 3
0
        public void IsValid_ReturnsFalse_WhenSkillRequestIsNull()
        {
            SkillRequestValidator sut = new SkillRequestValidator();

            Assert.False(sut.IsValid(null));
        }