-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestSetUp.cs
More file actions
37 lines (32 loc) · 1.12 KB
/
Copy pathTestSetUp.cs
File metadata and controls
37 lines (32 loc) · 1.12 KB
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
using System;
using System.IO;
using Microsoft.Extensions.Logging;
using NUnit.Framework;
using Serilog;
using Serilog.Extensions.Logging;
namespace YCodeLab.DB.Test
{
[SetUpFixture]
public class TestSetUp
{
[OneTimeSetUp]
public void SetUpBeforeAnyTests()
{
var pathToScriptSettingUpDb = TestContext.Parameters["pathToUpdateDevDbScript"];
if (string.IsNullOrEmpty(pathToScriptSettingUpDb))
pathToScriptSettingUpDb = "../../../../Scripts/update_dev_db.sh";
var cd = Directory.GetCurrentDirectory();
Environment.SetEnvironmentVariable("DB_ENVIRONMENT", "Development");
Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.MinimumLevel.Debug()
.CreateLogger();
var loggerFactory = new SerilogLoggerFactory();
new DevDBSetup.DevDBSetup(new DevDBSetup.AppSettings
{
ScriptBeforeSetup = pathToScriptSettingUpDb,
}, loggerFactory.CreateLogger<DevDBSetup.DevDBSetup>())
.Run();
}
}
}