-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #777 from StefanMaron/prerelease
Merge 'prerelease' into master
- Loading branch information
Showing
104 changed files
with
2,027 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
namespace BusinessCentral.LinterCop.Test; | ||
|
||
public class Rule0067 | ||
{ | ||
private string _testCaseDir = ""; | ||
|
||
[SetUp] | ||
public void Setup() | ||
{ | ||
_testCaseDir = Path.Combine(Directory.GetParent(Environment.CurrentDirectory)!.Parent!.Parent!.FullName, | ||
"TestCases", "Rule0067"); | ||
} | ||
|
||
[Test] | ||
[TestCase("1")] | ||
[TestCase("2")] | ||
[TestCase("3")] | ||
public async Task HasDiagnostic(string testCase) | ||
{ | ||
var code = await File.ReadAllTextAsync(Path.Combine(_testCaseDir, "HasDiagnostic", $"{testCase}.al")) | ||
.ConfigureAwait(false); | ||
|
||
var fixture = RoslynFixtureFactory.Create<Rule0013CheckForNotBlankOnSingleFieldPrimaryKeys>(); | ||
fixture.HasDiagnostic(code, Rule0013CheckForNotBlankOnSingleFieldPrimaryKeys.DiagnosticDescriptors.Rule0067DisableNotBlankOnSingleFieldPrimaryKey.Id); | ||
} | ||
|
||
[Test] | ||
[TestCase("1")] | ||
[TestCase("2")] | ||
[TestCase("3")] | ||
[TestCase("4")] | ||
public async Task NoDiagnostic(string testCase) | ||
{ | ||
var code = await File.ReadAllTextAsync(Path.Combine(_testCaseDir, "NoDiagnostic", $"{testCase}.al")) | ||
.ConfigureAwait(false); | ||
|
||
var fixture = RoslynFixtureFactory.Create<Rule0013CheckForNotBlankOnSingleFieldPrimaryKeys>(); | ||
fixture.NoDiagnosticAtMarker(code, Rule0013CheckForNotBlankOnSingleFieldPrimaryKeys.DiagnosticDescriptors.Rule0067DisableNotBlankOnSingleFieldPrimaryKey.Id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
namespace BusinessCentral.LinterCop.Test; | ||
|
||
public class Rule0068 | ||
{ | ||
private string _testCaseDir = ""; | ||
|
||
[SetUp] | ||
public void Setup() | ||
{ | ||
_testCaseDir = Path.Combine(Directory.GetParent(Environment.CurrentDirectory)!.Parent!.Parent!.FullName, | ||
"TestCases", "Rule0068"); | ||
} | ||
|
||
[Test] | ||
[TestCase("ProcedureCalls")] | ||
[TestCase("XmlPorts")] | ||
[TestCase("Queries")] | ||
[TestCase("Reports")] | ||
public async Task HasDiagnostic(string testCase) | ||
{ | ||
var code = await File.ReadAllTextAsync(Path.Combine(_testCaseDir, "HasDiagnostic", $"{testCase}.al")) | ||
.ConfigureAwait(false); | ||
|
||
var fixture = RoslynFixtureFactory.Create<Rule0068CheckObjectPermission>(); | ||
fixture.HasDiagnostic(code, Rule0068CheckObjectPermission.DiagnosticDescriptors.Rule0068CheckObjectPermission.Id); | ||
} | ||
|
||
[Test] | ||
[TestCase("ProcedureCallsPermissionsProperty")] | ||
[TestCase("XmlPortPermissionsProperty")] | ||
[TestCase("QueryPermissionsProperty")] | ||
[TestCase("XmlPortInherentPermissions")] | ||
[TestCase("QueryInherentPermissions")] | ||
[TestCase("ReportPermissionsProperty")] | ||
[TestCase("ReportInherentPermissions")] | ||
[TestCase("ProcedureCallsInherentPermissionsProperty")] | ||
[TestCase("ProcedureCallsInherentPermissionsAttribute")] | ||
[TestCase("PageSourceTable")] | ||
#if Fall2023RV1 | ||
[TestCase("ProcedureCallsPermissionsPropertyFullyQualified")] | ||
#endif | ||
// [TestCase("IntegerTable")] | ||
[TestCase("XMLPortWithTableElementProps")] | ||
public async Task NoDiagnostic(string testCase) | ||
{ | ||
var code = await File.ReadAllTextAsync(Path.Combine(_testCaseDir, "NoDiagnostic", $"{testCase}.al")) | ||
.ConfigureAwait(false); | ||
|
||
var fixture = RoslynFixtureFactory.Create<Rule0068CheckObjectPermission>(); | ||
fixture.NoDiagnosticAtMarker(code, Rule0068CheckObjectPermission.DiagnosticDescriptors.Rule0068CheckObjectPermission.Id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace BusinessCentral.LinterCop.Test; | ||
|
||
public class Rule0069 | ||
{ | ||
private string _testCaseDir = ""; | ||
|
||
[SetUp] | ||
public void Setup() | ||
{ | ||
_testCaseDir = Path.Combine(Directory.GetParent(Environment.CurrentDirectory)!.Parent!.Parent!.FullName, | ||
"TestCases", "Rule0069"); | ||
} | ||
|
||
[Test] | ||
[TestCase("1")] | ||
public async Task HasDiagnostic(string testCase) | ||
{ | ||
var code = await File.ReadAllTextAsync(Path.Combine(_testCaseDir, "HasDiagnostic", $"{testCase}.al")) | ||
.ConfigureAwait(false); | ||
|
||
var fixture = RoslynFixtureFactory.Create<Rule0069EmptyStatements>(); | ||
fixture.HasDiagnostic(code, DiagnosticDescriptors.Rule0069EmptyStatements.Id); | ||
} | ||
|
||
[Test] | ||
[TestCase("1")] | ||
[TestCase("2")] | ||
[TestCase("3")] | ||
public async Task NoDiagnostic(string testCase) | ||
{ | ||
var code = await File.ReadAllTextAsync(Path.Combine(_testCaseDir, "NoDiagnostic", $"{testCase}.al")) | ||
.ConfigureAwait(false); | ||
|
||
var fixture = RoslynFixtureFactory.Create<Rule0069EmptyStatements>(); | ||
fixture.NoDiagnosticAtMarker(code, DiagnosticDescriptors.Rule0069EmptyStatements.Id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace BusinessCentral.LinterCop.Test; | ||
|
||
public class Rule0070 | ||
{ | ||
private string _testCaseDir = ""; | ||
|
||
[SetUp] | ||
public void Setup() | ||
{ | ||
_testCaseDir = Path.Combine(Directory.GetParent(Environment.CurrentDirectory)!.Parent!.Parent!.FullName, | ||
"TestCases", "Rule0070"); | ||
} | ||
|
||
[Test] | ||
[TestCase("1")] | ||
[TestCase("2")] | ||
public async Task HasDiagnostic(string testCase) | ||
{ | ||
var code = await File.ReadAllTextAsync(Path.Combine(_testCaseDir, "HasDiagnostic", $"{testCase}.al")) | ||
.ConfigureAwait(false); | ||
|
||
var fixture = RoslynFixtureFactory.Create<Rule0070ListObjectsAreOneBased>(); | ||
fixture.HasDiagnostic(code, Rule0070ListObjectsAreOneBased.DiagnosticDescriptors.Rule0070ListObjectsAreOneBased.Id); | ||
} | ||
|
||
[Test] | ||
[TestCase("1")] | ||
[TestCase("2")] | ||
public async Task NoDiagnostic(string testCase) | ||
{ | ||
var code = await File.ReadAllTextAsync(Path.Combine(_testCaseDir, "NoDiagnostic", $"{testCase}.al")) | ||
.ConfigureAwait(false); | ||
|
||
var fixture = RoslynFixtureFactory.Create<Rule0070ListObjectsAreOneBased>(); | ||
fixture.NoDiagnosticAtMarker(code, Rule0070ListObjectsAreOneBased.DiagnosticDescriptors.Rule0070ListObjectsAreOneBased.Id); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
BusinessCentral.LinterCop.Test/TestCases/Rule0004/NoDiagnostic/2.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[|table 50100 MyTable|] | ||
{ | ||
fields | ||
{ | ||
field(1; MyField; Integer) {} | ||
} | ||
} | ||
|
||
page 50100 MyPage | ||
{ | ||
PageType = List; | ||
SourceTable = MyTable; | ||
SourceTableTemporary = true; | ||
} |
34 changes: 34 additions & 0 deletions
34
BusinessCentral.LinterCop.Test/TestCases/Rule0067/HasDiagnostic/1.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
table 50100 MyTable | ||
{ | ||
fields | ||
{ | ||
[|field(1; MyField; Code[20])|] | ||
{ | ||
NotBlank = true; | ||
} | ||
field(2; "No. Series"; Code[20]) | ||
{ | ||
TableRelation = "No. Series"; | ||
} | ||
} | ||
|
||
keys | ||
{ | ||
key(Key1; MyField) | ||
{ | ||
Clustered = true; | ||
} | ||
} | ||
} | ||
|
||
table 308 "No. Series" | ||
{ | ||
fields | ||
{ | ||
field(1; "Code"; Code[20]) | ||
{ | ||
Caption = 'Code'; | ||
NotBlank = true; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
BusinessCentral.LinterCop.Test/TestCases/Rule0067/HasDiagnostic/2.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
table 50100 MyTable | ||
{ | ||
fields | ||
{ | ||
[|field(1; MyField; Code[20])|] | ||
{ | ||
NotBlank = true; | ||
} | ||
field(2; "No. Series"; Code[20]) | ||
{ | ||
TableRelation = "No. Series".Code; | ||
} | ||
} | ||
|
||
keys | ||
{ | ||
key(Key1; MyField) | ||
{ | ||
Clustered = true; | ||
} | ||
} | ||
} | ||
|
||
table 308 "No. Series" | ||
{ | ||
fields | ||
{ | ||
field(1; "Code"; Code[20]) | ||
{ | ||
Caption = 'Code'; | ||
NotBlank = true; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
BusinessCentral.LinterCop.Test/TestCases/Rule0067/HasDiagnostic/3.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
table 50100 MyTable | ||
{ | ||
fields | ||
{ | ||
[|field(1; MyField; Code[20])|] | ||
{ | ||
NotBlank = true; | ||
} | ||
field(2; "No. Series"; Code[20]) | ||
{ | ||
TableRelation = "No. Series"."Code"; | ||
} | ||
} | ||
|
||
keys | ||
{ | ||
key(Key1; MyField) | ||
{ | ||
Clustered = true; | ||
} | ||
} | ||
} | ||
|
||
table 308 "No. Series" | ||
{ | ||
fields | ||
{ | ||
field(1; "Code"; Code[20]) | ||
{ | ||
Caption = 'Code'; | ||
NotBlank = true; | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
BusinessCentral.LinterCop.Test/TestCases/Rule0067/NoDiagnostic/1.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
table 50100 MyTable | ||
{ | ||
fields | ||
{ | ||
[|field(1; MyField; Code[20])|] { } | ||
} | ||
|
||
keys | ||
{ | ||
key(Key1; MyField) | ||
{ | ||
Clustered = true; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
BusinessCentral.LinterCop.Test/TestCases/Rule0067/NoDiagnostic/2.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
table 50100 MyTable | ||
{ | ||
fields | ||
{ | ||
[|field(1; MyField; Code[20])|] | ||
{ | ||
NotBlank = true; | ||
} | ||
} | ||
|
||
keys | ||
{ | ||
key(Key1; MyField) | ||
{ | ||
Clustered = true; | ||
} | ||
} | ||
} |
Oops, something went wrong.