-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathRule0083.cs
43 lines (37 loc) · 1.37 KB
/
Rule0083.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
namespace BusinessCentral.LinterCop.Test;
#if !LessThenFall2024
public class Rule0083
{
private string _testCaseDir = "";
[SetUp]
public void Setup()
{
_testCaseDir = Path.Combine(Directory.GetParent(Environment.CurrentDirectory)!.Parent!.Parent!.FullName,
"TestCases", "Rule0083");
}
[Test]
[TestCase("Date2DMY")]
[TestCase("Date2DWY")]
[TestCase("DT2Date")]
[TestCase("DT2Time")]
[TestCase("FormatHour")]
[TestCase("FormatMillisecond")]
[TestCase("FormatMinute")]
[TestCase("FormatSecond")]
public async Task HasDiagnostic(string testCase)
{
var code = await File.ReadAllTextAsync(Path.Combine(_testCaseDir, "HasDiagnostic", $"{testCase}.al"))
.ConfigureAwait(false);
var fixture = RoslynFixtureFactory.Create<Rule0083BuiltInDateTimeMethod>();
fixture.HasDiagnostic(code, DiagnosticDescriptors.Rule0083BuiltInDateTimeMethod.Id);
}
// [Test]
// public async Task NoDiagnostic(string testCase)
// {
// var code = await File.ReadAllTextAsync(Path.Combine(_testCaseDir, "NoDiagnostic", $"{testCase}.al"))
// .ConfigureAwait(false);
// var fixture = RoslynFixtureFactory.Create<Rule0083BuiltInDateTimeMethod>();
// fixture.NoDiagnosticAtMarker(code, DiagnosticDescriptors.Rule0083BuiltInDateTimeMethod.Id);
// }
}
#endif