forked from southworks/BotFramework-FunctionalTests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScriptTestBase.cs
54 lines (44 loc) · 1.91 KB
/
ScriptTestBase.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.Collections.Generic;
using System.IO;
using Microsoft.Bot.Builder.Testing.TestRunner.TestClients;
using Microsoft.Bot.Builder.Tests.Functional.Skills.Common;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Xunit.Abstractions;
namespace Microsoft.Bot.Builder.Tests.Functional
{
public class ScriptTestBase
{
public ScriptTestBase(ITestOutputHelper output)
{
var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.AddJsonFile("appsettings.Development.json", true, true)
.AddEnvironmentVariables()
.Build();
var loggerFactory = LoggerFactory.Create(builder =>
{
builder
.AddConfiguration(configuration.GetSection("Logging"))
.AddConsole()
.AddDebug()
.AddFile(Directory.GetCurrentDirectory() + @"/Logs/Log.json", isJson: true)
.AddXunit(output);
});
Logger = loggerFactory.CreateLogger<ScriptTestBase>();
TestRequestTimeout = int.Parse(configuration["TestRequestTimeout"]);
TestClientOptions = configuration.GetSection("HostBotClientOptions").Get<Dictionary<HostBot, DirectLineTestClientOptions>>();
ThinkTime = int.Parse(configuration["ThinkTime"]);
}
public static List<string> Channels { get; } = new List<string>
{
Connector.Channels.Directline
};
public Dictionary<HostBot, DirectLineTestClientOptions> TestClientOptions { get; }
public ILogger Logger { get; }
public int TestRequestTimeout { get; }
public int ThinkTime { get; }
}
}