Ejemplo n.º 1
0
 public static void AdapterNotNull(ActivityAdapterBase adapter)
 {
     if (adapter == null)
     {
         throw new ArgumentNullException(nameof(adapter));
     }
 }
Ejemplo n.º 2
0
        public async Task AdapterProperty()
        {
            TestAdapter adapter = new TestAdapter();
            Bot         bot     = new Bot(adapter);

            ActivityAdapterBase retrievedAdapter = bot.Adapter;

            // Verify the Bot a property to allow retrieving the Adapter.
            Assert.AreSame(adapter, retrievedAdapter);
        }
Ejemplo n.º 3
0
        public Bot(ActivityAdapterBase adapter) : base()
        {
            BotAssert.AdapterNotNull(adapter);
            _adapter = adapter;

            // Hook up the Adapter so that incoming data is routed
            // through the Middleware Pipeline
            _adapter.OnReceive = this.RunPipeline;

            this.Use(new Middleware.SendToAdapterMiddleware(this));
            this.Use(new Middleware.TemplateManager());
        }