From 6ca3d6e683ca138a72acd06717388b43843a6cee Mon Sep 17 00:00:00 2001 From: Graham Pentheny Date: Mon, 2 Sep 2024 14:41:11 -0400 Subject: [PATCH] Silenced unused parameter compiler warnings in unit tests --- test/ConfigKeyTests.cs | 8 ++++++++ test/TypeReifierTests.cs | 2 ++ 2 files changed, 10 insertions(+) diff --git a/test/ConfigKeyTests.cs b/test/ConfigKeyTests.cs index 4cf53ad..f914aaf 100644 --- a/test/ConfigKeyTests.cs +++ b/test/ConfigKeyTests.cs @@ -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] @@ -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] @@ -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] @@ -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] diff --git a/test/TypeReifierTests.cs b/test/TypeReifierTests.cs index 9f42a1c..a8dc677 100644 --- a/test/TypeReifierTests.cs +++ b/test/TypeReifierTests.cs @@ -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; }