Skip to content

Commit

Permalink
Fix MSTEST00236 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cagrin committed Sep 19, 2024
1 parent 0a83a8e commit dfa0911
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions SqlTest.Tests/DatabaseTests/BaseDatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SqlTest.DatabaseTests;
[TestClass]
public class BaseDatabaseTests
{
public static IEnumerable<object[]> Images => new[]
public static IEnumerable<object[]> BaseImages => new[]
{
new object[] { "mcr.microsoft.com/mssql/server:2019-latest" },
new object[] { "mcr.microsoft.com/mssql/server:2022-latest" },
Expand All @@ -12,7 +12,7 @@ public class BaseDatabaseTests
public string Folder { get; init; } = "../../../../Database.Tests";

[TestMethod]
[DynamicData(nameof(Images))]
[DynamicData(nameof(BaseImages))]
public void InvokeDockerPullPassed(string image)
{
var results = SystemConsole.Invoke($"docker pull {image}; echo $LASTEXITCODE");
Expand Down
2 changes: 1 addition & 1 deletion SqlTest.Tests/DatabaseTests/CollationDatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SqlTest.DatabaseTests;
[TestClass]
public class CollationDatabaseTests : BaseDatabaseTests
{
public static new IEnumerable<object[]> Images => BaseDatabaseTests.Images;
public static IEnumerable<object[]> Images => BaseImages;

[TestMethod]
[DynamicData(nameof(Images))]
Expand Down
2 changes: 1 addition & 1 deletion SqlTest.Tests/DatabaseTests/ErrorDatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SqlTest.DatabaseTests;
[TestClass]
public class ErrorDatabaseTests : BaseDatabaseTests
{
public static new IEnumerable<object[]> Images => BaseDatabaseTests.Images;
public static IEnumerable<object[]> Images => BaseImages;

[TestMethod]
[DynamicData(nameof(Images))]
Expand Down
2 changes: 1 addition & 1 deletion SqlTest.Tests/DatabaseTests/ExceptionDatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SqlTest.DatabaseTests;
[TestClass]
public class ExceptionDatabaseTests : BaseDatabaseTests
{
public static new IEnumerable<object[]> Images => BaseDatabaseTests.Images;
public static IEnumerable<object[]> Images => BaseImages;

[TestMethod]
[DynamicData(nameof(Images))]
Expand Down
2 changes: 1 addition & 1 deletion SqlTest.Tests/DatabaseTests/FailDatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SqlTest.DatabaseTests;
[TestClass]
public class FailDatabaseTests : BaseDatabaseTests
{
public static new IEnumerable<object[]> Images => BaseDatabaseTests.Images;
public static IEnumerable<object[]> Images => BaseImages;

[TestMethod]
[DynamicData(nameof(Images))]
Expand Down
2 changes: 1 addition & 1 deletion SqlTest.Tests/DatabaseTests/OkDatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SqlTest.DatabaseTests;
[TestClass]
public class OkDatabaseTests : BaseDatabaseTests
{
public static new IEnumerable<object[]> Images => BaseDatabaseTests.Images;
public static IEnumerable<object[]> Images => BaseImages;

[TestMethod]
[DynamicData(nameof(Images))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SqlTest.ProjectReferencesTests;
[TestClass]
public class IncludeDatabaseTests
{
public static IEnumerable<object[]> Images => BaseDatabaseTests.Images;
public static IEnumerable<object[]> Images => BaseDatabaseTests.BaseImages;

public string Folder { get; init; } = "../../../../ProjectReferences.Tests";

Expand Down
7 changes: 7 additions & 0 deletions SqlTest.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -574,5 +574,12 @@
<Rule Id="MSTEST0024" Action="Warning" /> <!-- Do not store TestContext in a static member -->
<Rule Id="MSTEST0025" Action="Warning" /> <!-- Use 'Assert.Fail' instead of an always-failing assert -->
<Rule Id="MSTEST0026" Action="Warning" /> <!-- Avoid conditional access in assertions -->
<Rule Id="MSTEST0029" Action="Warning" /> <!-- Public method should be test method-->
<Rule Id="MSTEST0030" Action="Warning" /> <!-- Type containing TestMethod should be marked with TestClass -->
<Rule Id="MSTEST0031" Action="Warning" /> <!-- System.ComponentModel.DescriptionAttribute has no effect on test methodss -->
<Rule Id="MSTEST0032" Action="Warning" /> <!-- Review or remove the assertion as its condition is known to be always true -->
<Rule Id="MSTEST0034" Action="Warning" /> <!-- Use ClassCleanupBehavior.EndOfClass with the ClassCleanup -->
<Rule Id="MSTEST0035" Action="Warning" /> <!-- DeploymentItem can be specified only on test class or test method -->
<Rule Id="MSTEST0035" Action="Warning" /> <!-- Do not use shadowing inside test class -->
</Rules>
</RuleSet>

0 comments on commit dfa0911

Please sign in to comment.