/// <summary>
 /// Initializes a new instance of the <see cref="TestRunner"/> class.
 /// </summary>
 /// <param name="client">Test client to use.</param>
 /// <param name="replyTimeout">The timeout for waiting for replies (in miliseconds). Default is 180000.</param>
 /// <param name="thinkTime">The timeout think time before sending messages to the bot (in miliseconds). Default is 0.</param>
 /// <param name="logger">Optional. Instance of <see cref="ILogger"/> to use.</param>
 public TestRunner(TestClientBase client, int replyTimeout = 180000, int thinkTime = 0, ILogger logger = null)
 {
     _testClient   = client;
     _replyTimeout = replyTimeout;
     _thinkTime    = thinkTime;
     _logger       = logger ?? NullLogger.Instance;
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestClientFactory"/> class.
        /// </summary>
        /// <param name="client">The type of client to create.</param>
        public TestClientFactory(ClientType client)
        {
            var configuration = new ConfigurationBuilder()
                                .AddJsonFile("appsettings.json")
                                .AddJsonFile("appsettings.Development.json", true, true)
                                .AddEnvironmentVariables()
                                .Build();

            switch (client)
            {
            case ClientType.DirectLine:
                _testClientBase = new DirectLineTestClient(configuration);
                break;

            case ClientType.Emulator:
                break;

            case ClientType.Teams:
                break;

            case ClientType.Facebook:
                break;

            case ClientType.Slack:
                break;

            default:
                _testClientBase = new DirectLineTestClient(configuration);
                break;
            }
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestClientFactory"/> class.
        /// </summary>
        /// <param name="client">The type of client to create.</param>
        /// <param name="options">The options to create the client.</param>
        /// <param name="logger">An optional <see cref="ILogger"/> instance.</param>
        public TestClientFactory(ClientType client, DirectLineTestClientOptions options, ILogger logger)
        {
            switch (client)
            {
            case ClientType.DirectLine:
                _testClientBase = new DirectLineTestClient(options, logger);
                break;

            case ClientType.Emulator:
                break;

            case ClientType.Teams:
                break;

            case ClientType.Facebook:
                break;

            case ClientType.Slack:
                break;

            default:
                throw new InvalidEnumArgumentException($"Invalid client type ({client})");
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TestClientFactory"/> class.
        /// </summary>
        /// <param name="channel">The type of channel to create based on the <see cref="Channels"/> class.</param>
        /// <param name="options">The options to create the client.</param>
        /// <param name="logger">An optional <see cref="ILogger"/> instance.</param>
        public TestClientFactory(string channel, DirectLineTestClientOptions options, ILogger logger)
        {
            switch (channel)
            {
            case Channels.Directline:
                _testClientBase = new DirectLineTestClient(options, logger);
                break;

            case Channels.Emulator:
                break;

            case Channels.Msteams:
                break;

            case Channels.Facebook:
                break;

            case Channels.Slack:
                break;

            default:
                throw new InvalidEnumArgumentException($"Invalid client type ({channel})");
            }
        }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestRunner"/> class.
 /// </summary>
 /// <param name="client">Test client to use.</param>
 /// <param name="logger">Optional. Instance of <see cref="ILogger"/> to use.</param>
 public TestRunner(TestClientBase client, ILogger logger = null)
 {
     _testClient   = client;
     _replyTimeout = 45000;
     _logger       = logger ?? NullLogger.Instance;
 }