コード例 #1
0
 public TestFlow(Task testTask, TestAdapter adapter)
 {
     this.testTask = testTask ?? Task.CompletedTask;
     this._adapter = adapter;
 }
コード例 #2
0
 /// <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;
 }
コード例 #3
0
 /// <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)
 {
 }
コード例 #4
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, BotCallbackHandler callback = null)
 {
     _adapter  = adapter;
     _callback = callback;
     _testTask = _testTask ?? Task.CompletedTask;
 }
コード例 #5
0
 public TestFlow(TestAdapter adapter, IBot bot) : this(adapter, (ctx) => bot.OnTurn(ctx))
 {
 }
コード例 #6
0
 public TestFlow(Task testTask, TestFlow flow)
 {
     this.testTask = testTask ?? Task.CompletedTask;
     this.callback = flow.callback;
     this.adapter  = flow.adapter;
 }
コード例 #7
0
 public TestFlow(TestAdapter adapter, Func <ITurnContext, Task> callback = null)
 {
     this.adapter  = adapter;
     this.callback = callback;
     this.testTask = testTask ?? Task.CompletedTask;
 }
コード例 #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;
 }