-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTestHelper.cs
45 lines (39 loc) · 1.28 KB
/
TestHelper.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using MarkZither.KimaiDotNet.Core.Tests.Configuration;
namespace MarkZither.KimaiDotNet.Core.Tests
{
public static class TestHelper
{
public static IConfiguration GetIConfigurationRoot(string outputPath)
{
return new ConfigurationBuilder()
.SetBasePath(outputPath)
.AddJsonFile("appsettings.json", optional: true)
.AddEnvironmentVariables()
.AddUserSecrets<TestBase>()
.Build();
}
public static KimaiApiOptions GetApplicationConfiguration(string outputPath)
{
var iConfig = GetIConfigurationRoot(outputPath);
return (KimaiApiOptions)iConfig.Get(typeof(KimaiApiOptions));
}
}
public sealed class Authorization
{
private static readonly Lazy<Authorization>
lazy =
new Lazy<Authorization>
(() => new Authorization());
public static Authorization Instance { get { return lazy.Value; } }
private Authorization()
{
}
public string token;
}
}