示例#1
0
        public async Task GetLocaleFromActivity()
        {
            void ValidateResponses(Activity[] activities)
            {
                // no need to do anything.
            }

            var a = new SimpleAdapter(ValidateResponses);
            var c = new TurnContext(a, new Activity());

            var activityId = Guid.NewGuid().ToString();
            var activity   = TestMessage.Message();

            activity.Id     = activityId;
            activity.Locale = "de-DE";

            Task SimpleCallback(ITurnContext turnContext, CancellationToken cancellationToken)
            {
                Assert.Equal("de-DE", ((TurnContext)turnContext).Locale);
                return(Task.CompletedTask);
            }

            await a.ProcessRequest(activity, SimpleCallback, default(CancellationToken));
        }
示例#2
0
        public void RequestIsSet()
        {
            var c = new TurnContext(new SimpleAdapter(), TestMessage.Message());

            Assert.True(c.Activity.Id == "1234");
        }
示例#3
0
        public async Task RequestIsSet()
        {
            TurnContext c = new TurnContext(new SimpleAdapter(), TestMessage.Message());

            Assert.IsTrue(c.Activity.Id == "1234");
        }