Ejemplo n.º 1
0
        public async Task Should_SetResponded_When_Send()
        {
            //Arrange
            var turnContext = new TurnContext(adapter, activity);

            Assert.IsFalse(turnContext.Responded);

            //Act
            var response = await turnContext.SendActivitiesAsync(new IActivity[] { MessageFactory.Text("message1"), MessageFactory.Text("message2") });

            //Assert
            Assert.IsTrue(turnContext.Responded);
            Assert.AreEqual(2, response.Length);
        }
Ejemplo n.º 2
0
        public async Task SendBatchOfActivities()
        {
            var a = new SimpleAdapter();
            var c = new TurnContext(a, new Activity());

            Assert.False(c.Responded);

            var message1 = TestMessage.Message("message1");
            var message2 = TestMessage.Message("message2");

            var response = await c.SendActivitiesAsync(new IActivity[] { message1, message2 });

            Assert.True(c.Responded);
            Assert.True(response.Length == 2);
            Assert.True(response[0].Id == "message1");
            Assert.True(response[1].Id == "message2");
        }