Fix CA1515

This commit is contained in:
RoosterDragon
2025-11-11 18:42:12 +00:00
committed by Gustas Kažukauskas
parent 24c19f64c9
commit 42ac32dace
13 changed files with 19 additions and 14 deletions

View File

@@ -781,6 +781,9 @@ dotnet_diagnostic.CA1513.severity = warning
# Avoid redundant length argument. # Avoid redundant length argument.
dotnet_diagnostic.CA1514.severity = warning dotnet_diagnostic.CA1514.severity = warning
# Consider making public types internal.
dotnet_diagnostic.CA1515.severity = warning
### Naming Rules ### Naming Rules
### https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/naming-warnings ### https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/naming-warnings

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Test
sealed class MockLInfo : MockTraitInfo, NotBefore<MockJInfo> { } sealed class MockLInfo : MockTraitInfo, NotBefore<MockJInfo> { }
[TestFixture] [TestFixture]
public class ActorInfoTest sealed class ActorInfoTest
{ {
[TestCase(TestName = "Trait ordering sorts in dependency order correctly")] [TestCase(TestName = "Trait ordering sorts in dependency order correctly")]
public void TraitOrderingSortsCorrectly() public void TraitOrderingSortsCorrectly()

View File

@@ -14,7 +14,7 @@ using NUnit.Framework;
namespace OpenRA.Test namespace OpenRA.Test
{ {
[TestFixture] [TestFixture]
public class CPosTest sealed class CPosTest
{ {
[TestCase(TestName = "Packing x,y and layer into int")] [TestCase(TestName = "Packing x,y and layer into int")]
public void PackUnpackBits() public void PackUnpackBits()

View File

@@ -16,7 +16,7 @@ using NUnit.Framework;
namespace OpenRA.Test namespace OpenRA.Test
{ {
[TestFixture] [TestFixture]
public class CoordinateTest sealed class CoordinateTest
{ {
[TestCase(TestName = "Test CPos to MPos conversion and back again.")] [TestCase(TestName = "Test CPos to MPos conversion and back again.")]
public void CPosConversionRoundtrip() public void CPosConversionRoundtrip()

View File

@@ -15,7 +15,7 @@ using NUnit.Framework;
namespace OpenRA.Test namespace OpenRA.Test
{ {
[TestFixture] [TestFixture]
public class FluentTest sealed class FluentTest
{ {
readonly string pluralForms = @" readonly string pluralForms = @"
label-players = {$player -> label-players = {$player ->

View File

@@ -15,7 +15,7 @@ using OpenRA.Widgets;
namespace OpenRA.Test namespace OpenRA.Test
{ {
[TestFixture] [TestFixture]
public class MediatorTest sealed class MediatorTest
{ {
[TestCase(TestName = "Mediator test")] [TestCase(TestName = "Mediator test")]
public void Test() public void Test()
@@ -30,7 +30,7 @@ namespace OpenRA.Test
} }
} }
public class TestHandler : INotificationHandler<TestNotificaton> sealed class TestHandler : INotificationHandler<TestNotificaton>
{ {
public bool WasNotified { get; set; } public bool WasNotified { get; set; }
@@ -40,5 +40,5 @@ namespace OpenRA.Test
} }
} }
public class TestNotificaton { } sealed class TestNotificaton { }
} }

View File

@@ -21,7 +21,7 @@ using NUnit.Framework;
namespace OpenRA.Test namespace OpenRA.Test
{ {
[TestFixture] [TestFixture]
public class MiniYamlTest sealed class MiniYamlTest
{ {
[TestCase(TestName = "Parse tree roundtrips")] [TestCase(TestName = "Parse tree roundtrips")]
public void TestParseRoundtrip() public void TestParseRoundtrip()

View File

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Test namespace OpenRA.Test
{ {
[TestFixture] [TestFixture]
public class OrderTest sealed class OrderTest
{ {
static byte[] RoundTripOrder(byte[] bytes) static byte[] RoundTripOrder(byte[] bytes)
{ {

View File

@@ -15,7 +15,7 @@ using NUnit.Framework;
namespace OpenRA.Test namespace OpenRA.Test
{ {
[TestFixture] [TestFixture]
public class PlatformTest sealed class PlatformTest
{ {
string supportDir; string supportDir;
string engineDir; string engineDir;

View File

@@ -19,7 +19,7 @@ using OpenRA.Primitives;
namespace OpenRA.Test namespace OpenRA.Test
{ {
[TestFixture] [TestFixture]
public class PngTests sealed class PngTests
{ {
[Test] [Test]
public void Save_ShouldProduceValidPngFile() public void Save_ShouldProduceValidPngFile()
@@ -128,6 +128,8 @@ namespace OpenRA.Test
} }
} }
[Test]
[Ignore("Failing test should be fixed")]
public void PngConstructor_CompressionMethodNotSupported_ThrowsInvalidDataException() public void PngConstructor_CompressionMethodNotSupported_ThrowsInvalidDataException()
{ {
// Arrange // Arrange

View File

@@ -17,7 +17,7 @@ using OpenRA.Support;
namespace OpenRA.Test namespace OpenRA.Test
{ {
[TestFixture] [TestFixture]
public class VariableExpressionTest sealed class VariableExpressionTest
{ {
readonly IReadOnlyDictionary<string, int> testValues = new Dictionary<string, int> readonly IReadOnlyDictionary<string, int> testValues = new Dictionary<string, int>
{ {

View File

@@ -15,7 +15,7 @@ using OpenRA.Mods.Common.HitShapes;
namespace OpenRA.Test namespace OpenRA.Test
{ {
[TestFixture] [TestFixture]
public class ShapeTest sealed class ShapeTest
{ {
IHitShape shape; IHitShape shape;

View File

@@ -18,7 +18,7 @@ namespace OpenRA
{ {
using UtilityActions = Dictionary<string, KeyValuePair<Action<Utility, string[]>, Func<string[], bool>>>; using UtilityActions = Dictionary<string, KeyValuePair<Action<Utility, string[]>, Func<string[], bool>>>;
public class NoSuchCommandException : Exception sealed class NoSuchCommandException : Exception
{ {
public readonly string Command; public readonly string Command;
public NoSuchCommandException(string command) public NoSuchCommandException(string command)