From 3a2f3b7526e2c4a12fde6999d8d64b162fb4add4 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Tue, 2 Jan 2018 16:49:23 -0500 Subject: [PATCH] Resolving warnings --- ICD.Common.Utils.Tests/RecursionUtilsTest.cs | 9 +++++++-- ICD.Common.Utils/IcdConsole.cs | 1 - ICD.Common.Utils/Json/AbstractGenericJsonConverter.cs | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ICD.Common.Utils.Tests/RecursionUtilsTest.cs b/ICD.Common.Utils.Tests/RecursionUtilsTest.cs index e87e74c..95bbed2 100644 --- a/ICD.Common.Utils.Tests/RecursionUtilsTest.cs +++ b/ICD.Common.Utils.Tests/RecursionUtilsTest.cs @@ -8,7 +8,7 @@ namespace ICD.Common.Utils.Tests [TestFixture] public sealed class RecursionUtilsTest { - private IEnumerable Graph(int node) + private static IEnumerable Graph(int node) { switch (node) { @@ -29,6 +29,7 @@ namespace ICD.Common.Utils.Tests [Test] public void BreadthFirstSearchTest() { + // ReSharper disable once ReturnValueOfPureMethodIsNotUsed Assert.Throws(() => RecursionUtils.BreadthFirstSearch(1, null).ToArray()); int[] nodes = RecursionUtils.BreadthFirstSearch(1, Graph).ToArray(); @@ -43,8 +44,11 @@ namespace ICD.Common.Utils.Tests [Test] public void BreadthFirstSearchPathTest() { - Assert.Throws(() => RecursionUtils.BreadthFirstSearchPath(1, 4, null).ToArray()); + Assert.Throws(() => RecursionUtils.BreadthFirstSearchPath(1, 4, null)); + Assert.IsNull(RecursionUtils.BreadthFirstSearchPath(1, 5, Graph)); + + // ReSharper disable once AssignNullToNotNullAttribute int[] path = RecursionUtils.BreadthFirstSearchPath(1, 4, Graph).ToArray(); Assert.AreEqual(3, path.Length); @@ -63,6 +67,7 @@ namespace ICD.Common.Utils.Tests [Test] public void BreadthFirstSearchPathSingleNodeTest() { + // ReSharper disable once AssignNullToNotNullAttribute int[] path = RecursionUtils.BreadthFirstSearchPath(1, 1, Graph).ToArray(); Assert.AreEqual(1, path.Length); diff --git a/ICD.Common.Utils/IcdConsole.cs b/ICD.Common.Utils/IcdConsole.cs index bcbf993..2745f32 100644 --- a/ICD.Common.Utils/IcdConsole.cs +++ b/ICD.Common.Utils/IcdConsole.cs @@ -87,7 +87,6 @@ namespace ICD.Common.Utils #if SIMPLSHARP return CrestronConsole.SendControlSystemCommand(command, ref result); #else - result = string.Empty; return false; #endif } diff --git a/ICD.Common.Utils/Json/AbstractGenericJsonConverter.cs b/ICD.Common.Utils/Json/AbstractGenericJsonConverter.cs index 9f3e44a..900b1ce 100644 --- a/ICD.Common.Utils/Json/AbstractGenericJsonConverter.cs +++ b/ICD.Common.Utils/Json/AbstractGenericJsonConverter.cs @@ -12,7 +12,7 @@ namespace ICD.Common.Utils.Json /// The to write to. /// The value. /// The calling serializer. - public override sealed void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + public sealed override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { if (value == null) { @@ -42,7 +42,7 @@ namespace ICD.Common.Utils.Json /// /// The object value. /// - public override sealed object ReadJson(JsonReader reader, Type objectType, object existingValue, + public sealed override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType == JsonToken.Null)