Skip to content

Commit

Permalink
Silenced unused parameter compiler warnings in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamboree committed Sep 2, 2024
1 parent 8a52d03 commit 6ca3d6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/ConfigKeyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ public void ConfigKeyAttributeChangesParsing() {

class NullKeyClass {
[ConfigKey(null)]
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
public int fail;
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
}

[Test]
Expand All @@ -45,7 +47,9 @@ public void SettingANullKeyNameThrows() {

class EmptyKeyClass {
[ConfigKey("")]
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
public int fail;
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
}

[Test]
Expand All @@ -61,7 +65,9 @@ public void SettingAnEmptyKeyNameThrows() {

class WhitespaceKeyClass {
[ConfigKey(" ")]
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
public int fail;
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
}

[Test]
Expand All @@ -77,7 +83,9 @@ public void SettingAnAllWhitespaceKeyNameThrows() {

class PaddedKeyClass {
[ConfigKey(" after ")]
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
public int before;
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
}

[Test]
Expand Down
2 changes: 2 additions & 0 deletions test/TypeReifierTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ public int int3Value {

[ConfigMandatory]
protected class ClassWithInstancedAndStaticData {
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
public int instancedVal;
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
public static bool staticVal = false;
}

Expand Down

0 comments on commit 6ca3d6e

Please sign in to comment.