-
-
Notifications
You must be signed in to change notification settings - Fork 153
/
Copy pathVerifyDirectoryTests.cs
37 lines (32 loc) · 1.05 KB
/
VerifyDirectoryTests.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
public class VerifyDirectoryTests
{
static string directoryPathToVerify = Path.Combine(AttributeReader.GetSolutionDirectory(), "ToVerify");
#if NET8_0_OR_GREATER
#region AddTextFileConvention
[ModuleInitializer]
public static void InitTextFileConvention() =>
FileExtensions.AddTextFileConvention(
path =>
{
var name = Path.GetFileName(path);
return name.Equals("TextDocWithoutExtension", StringComparison.OrdinalIgnoreCase);
});
#endregion
#endif
[Fact]
public Task WithDirectory() =>
VerifyDirectory(directoryPathToVerify);
[Fact]
public Task WithDirectoryWithInfo() =>
VerifyDirectory(
directoryPathToVerify,
info: "the Info");
[ModuleInitializer]
public static void Init() =>
VerifierSettings.RegisterFileConverter(
"VerifyDirectoryTests",
(_, _) =>
new(
"info from FileConverter",
[new("txt", "text from FileConverter")]));
}