forked from microsoft/BotFramework-FunctionalTests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestClientFactory.cs
54 lines (50 loc) · 1.86 KB
/
TestClientFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.ComponentModel;
using Microsoft.Bot.Connector;
using Microsoft.Extensions.Logging;
using TranscriptTestRunner.TestClients;
namespace TranscriptTestRunner
{
/// <summary>
/// Factory class to create instances of <see cref="TestClientBase"/>.
/// </summary>
public class TestClientFactory
{
private readonly TestClientBase _testClientBase;
/// <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})");
}
}
/// <summary>
/// Gets the test client.
/// </summary>
/// <returns>The test client.</returns>
public TestClientBase GetTestClient()
{
return _testClientBase;
}
}
}