mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
Tidying
This commit is contained in:
@@ -201,25 +201,19 @@ namespace ICD.Common.Utils.Tests.Extensions
|
|||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void DictionaryEqualTest()
|
public void DictionaryEqualTest()
|
||||||
{
|
|
||||||
Assert.Inconclusive();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void DictionaryEqualComparerTest()
|
|
||||||
{
|
{
|
||||||
Dictionary<int, int> a = new Dictionary<int, int>
|
Dictionary<int, int> a = new Dictionary<int, int>
|
||||||
{
|
{
|
||||||
{1, 10},
|
{1, 10},
|
||||||
{2, 20},
|
{2, 20},
|
||||||
{ 3, 30 },
|
{3, 30}
|
||||||
};
|
};
|
||||||
|
|
||||||
Dictionary<int, int> b = new Dictionary<int, int>
|
Dictionary<int, int> b = new Dictionary<int, int>
|
||||||
{
|
{
|
||||||
{1, 10},
|
{1, 10},
|
||||||
{2, 20},
|
{2, 20},
|
||||||
{ 3, 30 },
|
{3, 30}
|
||||||
};
|
};
|
||||||
|
|
||||||
Dictionary<int, int> c = new Dictionary<int, int>
|
Dictionary<int, int> c = new Dictionary<int, int>
|
||||||
@@ -236,11 +230,41 @@ namespace ICD.Common.Utils.Tests.Extensions
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void DictionaryEqualFuncComparerTest()
|
public void DictionaryEqualComparerTest()
|
||||||
{
|
{
|
||||||
Assert.Inconclusive();
|
Assert.Inconclusive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void DictionaryEqualFuncComparerTest()
|
||||||
|
{
|
||||||
|
Dictionary<int, int> a = new Dictionary<int, int>
|
||||||
|
{
|
||||||
|
{1, 10},
|
||||||
|
{2, 20},
|
||||||
|
{3, 30}
|
||||||
|
};
|
||||||
|
|
||||||
|
Dictionary<int, int> b = new Dictionary<int, int>
|
||||||
|
{
|
||||||
|
{1, 10},
|
||||||
|
{2, 20},
|
||||||
|
{3, 30}
|
||||||
|
};
|
||||||
|
|
||||||
|
Dictionary<int, int> c = new Dictionary<int, int>
|
||||||
|
{
|
||||||
|
{1, 10},
|
||||||
|
{2, 20}
|
||||||
|
};
|
||||||
|
|
||||||
|
Assert.IsTrue(a.DictionaryEqual(b, (left, right) => left / 10 == right / 10));
|
||||||
|
Assert.IsTrue(b.DictionaryEqual(a, (left, right) => left / 10 == right / 10));
|
||||||
|
|
||||||
|
Assert.IsFalse(a.DictionaryEqual(c, (left, right) => left / 10 == right / 10));
|
||||||
|
Assert.IsFalse(c.DictionaryEqual(a, (left, right) => left / 10 == right / 10));
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void OrderByKeyTest()
|
public void OrderByKeyTest()
|
||||||
{
|
{
|
||||||
@@ -248,7 +272,7 @@ namespace ICD.Common.Utils.Tests.Extensions
|
|||||||
{
|
{
|
||||||
{1, 10},
|
{1, 10},
|
||||||
{2, 20},
|
{2, 20},
|
||||||
{ 3, 30 },
|
{3, 30}
|
||||||
};
|
};
|
||||||
|
|
||||||
KeyValuePair<int, int>[] ordered = a.OrderByKey().ToArray();
|
KeyValuePair<int, int>[] ordered = a.OrderByKey().ToArray();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using ICD.Common.Properties;
|
||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
using Crestron.SimplSharp.Reflection;
|
using Crestron.SimplSharp.Reflection;
|
||||||
#else
|
#else
|
||||||
@@ -12,16 +13,19 @@ namespace ICD.Common.Utils.Tests
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public sealed class ReflectionUtilsTest
|
public sealed class ReflectionUtilsTest
|
||||||
{
|
{
|
||||||
|
[UsedImplicitly]
|
||||||
private string TestProperty { get; set; }
|
private string TestProperty { get; set; }
|
||||||
|
|
||||||
|
[UsedImplicitly]
|
||||||
private void TestMethod(string param1, int param2)
|
private void TestMethod(string param1, int param2)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestClass
|
[UsedImplicitly]
|
||||||
|
private sealed class TestClass
|
||||||
{
|
{
|
||||||
public string Param1 { get; set; }
|
public string Param1 { get; }
|
||||||
public int Param2 { get; set; }
|
public int Param2 { get; }
|
||||||
|
|
||||||
public TestClass(string param1, int param2)
|
public TestClass(string param1, int param2)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user