mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 05:05:05 +00:00
Resolving warnings
This commit is contained in:
@@ -8,7 +8,7 @@ namespace ICD.Common.Utils.Tests
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public sealed class RecursionUtilsTest
|
public sealed class RecursionUtilsTest
|
||||||
{
|
{
|
||||||
private IEnumerable<int> Graph(int node)
|
private static IEnumerable<int> Graph(int node)
|
||||||
{
|
{
|
||||||
switch (node)
|
switch (node)
|
||||||
{
|
{
|
||||||
@@ -29,6 +29,7 @@ namespace ICD.Common.Utils.Tests
|
|||||||
[Test]
|
[Test]
|
||||||
public void BreadthFirstSearchTest()
|
public void BreadthFirstSearchTest()
|
||||||
{
|
{
|
||||||
|
// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
|
||||||
Assert.Throws<ArgumentNullException>(() => RecursionUtils.BreadthFirstSearch(1, null).ToArray());
|
Assert.Throws<ArgumentNullException>(() => RecursionUtils.BreadthFirstSearch(1, null).ToArray());
|
||||||
|
|
||||||
int[] nodes = RecursionUtils.BreadthFirstSearch(1, Graph).ToArray();
|
int[] nodes = RecursionUtils.BreadthFirstSearch(1, Graph).ToArray();
|
||||||
@@ -43,8 +44,11 @@ namespace ICD.Common.Utils.Tests
|
|||||||
[Test]
|
[Test]
|
||||||
public void BreadthFirstSearchPathTest()
|
public void BreadthFirstSearchPathTest()
|
||||||
{
|
{
|
||||||
Assert.Throws<ArgumentNullException>(() => RecursionUtils.BreadthFirstSearchPath(1, 4, null).ToArray());
|
Assert.Throws<ArgumentNullException>(() => RecursionUtils.BreadthFirstSearchPath(1, 4, null));
|
||||||
|
|
||||||
|
Assert.IsNull(RecursionUtils.BreadthFirstSearchPath(1, 5, Graph));
|
||||||
|
|
||||||
|
// ReSharper disable once AssignNullToNotNullAttribute
|
||||||
int[] path = RecursionUtils.BreadthFirstSearchPath(1, 4, Graph).ToArray();
|
int[] path = RecursionUtils.BreadthFirstSearchPath(1, 4, Graph).ToArray();
|
||||||
|
|
||||||
Assert.AreEqual(3, path.Length);
|
Assert.AreEqual(3, path.Length);
|
||||||
@@ -63,6 +67,7 @@ namespace ICD.Common.Utils.Tests
|
|||||||
[Test]
|
[Test]
|
||||||
public void BreadthFirstSearchPathSingleNodeTest()
|
public void BreadthFirstSearchPathSingleNodeTest()
|
||||||
{
|
{
|
||||||
|
// ReSharper disable once AssignNullToNotNullAttribute
|
||||||
int[] path = RecursionUtils.BreadthFirstSearchPath(1, 1, Graph).ToArray();
|
int[] path = RecursionUtils.BreadthFirstSearchPath(1, 1, Graph).ToArray();
|
||||||
|
|
||||||
Assert.AreEqual(1, path.Length);
|
Assert.AreEqual(1, path.Length);
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ namespace ICD.Common.Utils
|
|||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
return CrestronConsole.SendControlSystemCommand(command, ref result);
|
return CrestronConsole.SendControlSystemCommand(command, ref result);
|
||||||
#else
|
#else
|
||||||
result = string.Empty;
|
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace ICD.Common.Utils.Json
|
|||||||
/// <param name="writer">The <see cref="T:Newtonsoft.Json.JsonWriter"/> to write to.</param>
|
/// <param name="writer">The <see cref="T:Newtonsoft.Json.JsonWriter"/> to write to.</param>
|
||||||
/// <param name="value">The value.</param>
|
/// <param name="value">The value.</param>
|
||||||
/// <param name="serializer">The calling serializer.</param>
|
/// <param name="serializer">The calling serializer.</param>
|
||||||
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)
|
if (value == null)
|
||||||
{
|
{
|
||||||
@@ -42,7 +42,7 @@ namespace ICD.Common.Utils.Json
|
|||||||
/// <returns>
|
/// <returns>
|
||||||
/// The object value.
|
/// The object value.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public override sealed object ReadJson(JsonReader reader, Type objectType, object existingValue,
|
public sealed override object ReadJson(JsonReader reader, Type objectType, object existingValue,
|
||||||
JsonSerializer serializer)
|
JsonSerializer serializer)
|
||||||
{
|
{
|
||||||
if (reader.TokenType == JsonToken.Null)
|
if (reader.TokenType == JsonToken.Null)
|
||||||
|
|||||||
Reference in New Issue
Block a user