예제 #1
0
        public void Namespace_and_action_set_string()
        {
            IntentSignature name = "AMAZON.CancelIntent";

            Assert.Equal("AMAZON", name.Namespace);
            Assert.Equal("CancelIntent", name.Action);
        }
예제 #2
0
        public void Intent_action_set_string()
        {
            var             expected = "CancelIntent";
            IntentSignature name     = expected;

            Assert.Equal(expected, name.Action);
        }
예제 #3
0
        public void Complex_intent_single_property()
        {
            const string    complexIntentSingleProperty = "AMAZON.SearchAction<object@WeatherForecast>";
            IntentSignature name = complexIntentSingleProperty;

            Assert.Equal("AMAZON", name.Namespace);
            Assert.Equal("SearchAction", name.Action);
            Assert.Equal(1, name.Properties.Count);

            Assert.True(name.Properties.ContainsKey("object"));
            Assert.Equal("WeatherForecast", name.Properties["object"].Entity);
        }
예제 #4
0
        public void Complex_intent_two_properties()
        {
            const string complexIntentTwoProperties = "AMAZON.AddAction<object@Book,targetCollection@ReadingList>";

            IntentSignature name = complexIntentTwoProperties;

            Assert.Equal("AMAZON", name.Namespace);
            Assert.Equal("AddAction", name.Action);
            Assert.Equal(2, name.Properties.Count);

            Assert.True(name.Properties.ContainsKey("object"));
            Assert.Equal("Book", name.Properties["object"].Entity);

            Assert.True(name.Properties.ContainsKey("targetCollection"));
            Assert.Equal("ReadingList", name.Properties["targetCollection"].Entity);
        }