public TestFlow(Task testTask, TestAdapter adapter)
 {
     this.testTask = testTask ?? Task.CompletedTask;
     this._adapter = adapter;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TestFlow"/> class from an existing flow.
 /// </summary>
 /// <param name="testTask">The exchange to add to the exchanges in the existing flow.</param>
 /// <param name="flow">The flow to build up from. This provides the test adapter to use,
 /// the bot turn processing locig to test, and a set of exchanges to model and test.</param>
 public TestFlow(Task testTask, TestFlow flow)
 {
     _testTask = testTask ?? Task.CompletedTask;
     _callback = flow._callback;
     _adapter  = flow._adapter;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TestFlow"/> class.
 /// </summary>
 /// <param name="adapter">The test adapter to use.</param>
 /// <param name="bot">The bot containing the turn processing logic to test.</param>
 public TestFlow(TestAdapter adapter, IBot bot)
     : this(adapter, bot.OnTurnAsync)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TestFlow"/> class.
 /// </summary>
 /// <param name="adapter">The test adapter to use.</param>
 /// <param name="callback">The bot turn processing logic to test.</param>
 public TestFlow(TestAdapter adapter, BotCallbackHandler callback = null)
 {
     _adapter  = adapter;
     _callback = callback;
     _testTask = _testTask ?? Task.CompletedTask;
 }
 public TestFlow(TestAdapter adapter, IBot bot) : this(adapter, (ctx) => bot.OnTurn(ctx))
 {
 }
 public TestFlow(Task testTask, TestFlow flow)
 {
     this.testTask = testTask ?? Task.CompletedTask;
     this.callback = flow.callback;
     this.adapter  = flow.adapter;
 }
 public TestFlow(TestAdapter adapter, Func <ITurnContext, Task> callback = null)
 {
     this.adapter  = adapter;
     this.callback = callback;
     this.testTask = testTask ?? Task.CompletedTask;
 }
Beispiel #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestFlow"/> class.
 /// </summary>
 /// <param name="adapter">The test adapter to use.</param>
 /// <param name="callback">The bot turn processing logic to test.</param>
 public TestFlow(TestAdapter adapter, Func <ITurnContext, Task> callback = null)
 {
     _adapter  = adapter;
     _callback = callback;
     _testTask = _testTask ?? Task.CompletedTask;
 }