-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathAllureXunitConfiguration.cs
More file actions
46 lines (38 loc) · 1.31 KB
/
AllureXunitConfiguration.cs
File metadata and controls
46 lines (38 loc) · 1.31 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
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using Allure.Net.Commons;
using Allure.Net.Commons.Configuration;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
#nullable enable
namespace Allure.Xunit
{
internal class AllureXunitConfiguration : AllureConfiguration
{
const string KNOWN_TOOL_REQNROLL = "Reqnroll";
const string KNOWN_TOOL_SPECFLOW = "TechTalk.SpecFlow";
public string XunitRunnerReporter { get; set; } = "auto";
public List<string> FirstClassIntegrationTools { get; set; } = [
KNOWN_TOOL_REQNROLL,
KNOWN_TOOL_SPECFLOW,
];
[JsonConstructor]
protected AllureXunitConfiguration(
string? title,
string? directory,
HashSet<string>? links
) : base(title, directory, links)
{
}
public static AllureXunitConfiguration CurrentConfig
{
get => currentConfig.Value;
}
static readonly Lazy<AllureXunitConfiguration> currentConfig
= new(ParseCurrentConfig);
static AllureXunitConfiguration ParseCurrentConfig() => JObject.Parse(
AllureLifecycle.Instance.JsonConfiguration
)["allure"]?.ToObject<AllureXunitConfiguration>()
?? new AllureXunitConfiguration(null, null, null);
}
}