mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
Tidying, additional test stubs
This commit is contained in:
50
ICD.Common.Utils.Tests/Extensions/HashSetExtensionsTest.cs
Normal file
50
ICD.Common.Utils.Tests/Extensions/HashSetExtensionsTest.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace ICD.Common.Utils.Tests.Extensions
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public sealed class HashSetExtensionsTest
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public void SubtractTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void IsSubsetOfTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void IntersectionTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void NonIntersectionTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void IsProperSubsetOfTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void IsSupersetOfTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void IsProperSupersetOfTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
38
ICD.Common.Utils.Tests/Extensions/JsonExtensionsTest.cs
Normal file
38
ICD.Common.Utils.Tests/Extensions/JsonExtensionsTest.cs
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace ICD.Common.Utils.Tests.Extensions
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public sealed class JsonExtensionsTest
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public void WriteObjectTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void GetValueAsIntTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void GetValueAsStringTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void GetValueAsBoolTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void GetValueAsEnumTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace ICD.Common.Utils.Tests.Extensions
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public sealed class ReflectionExtensionsTest
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public void GetCustomAttributesTest()
|
||||||
|
{
|
||||||
|
Assert.Inconclusive();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -112,16 +112,17 @@ namespace ICD.Common.Utils
|
|||||||
s_TypeToAttributesCache[type] = new IcdHashSet<Attribute>(type.GetCustomAttributes<Attribute>(false));
|
s_TypeToAttributesCache[type] = new IcdHashSet<Attribute>(type.GetCustomAttributes<Attribute>(false));
|
||||||
methods = type.GetMethods();
|
methods = type.GetMethods();
|
||||||
#else
|
#else
|
||||||
s_TypeToAttributesCache[type] = new IcdHashSet<Attribute>(type.GetTypeInfo().GetCustomAttributes<Attribute>(false));
|
s_TypeToAttributesCache[type] =
|
||||||
methods = type.GetTypeInfo().GetMethods();
|
new IcdHashSet<Attribute>(ReflectionExtensions.GetCustomAttributes<Attribute>(type.GetTypeInfo(), false));
|
||||||
|
methods = type.GetTypeInfo().GetMethods();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
// GetMethods for Open Generic Types is not supported.
|
// GetMethods for Open Generic Types is not supported.
|
||||||
catch (NotSupportedException)
|
catch (NotSupportedException)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Not sure why this happens :/
|
// Not sure why this happens :/
|
||||||
catch (InvalidProgramException)
|
catch (InvalidProgramException)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -111,13 +111,13 @@ namespace ICD.Common.Attributes.Rpc
|
|||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
.GetCType()
|
.GetCType()
|
||||||
#else
|
#else
|
||||||
.GetTypeInfo()
|
.GetTypeInfo()
|
||||||
#endif
|
#endif
|
||||||
.GetMethods(BindingFlags.Public |
|
.GetMethods(BindingFlags.Public |
|
||||||
BindingFlags.NonPublic |
|
BindingFlags.NonPublic |
|
||||||
BindingFlags.Instance)
|
BindingFlags.Instance)
|
||||||
.Where(m => m.GetCustomAttributes<RpcAttribute>(true)
|
.Where(m => ReflectionExtensions.GetCustomAttributes<RpcAttribute>(m, true)
|
||||||
.Any(a => a.m_Key == key))
|
.Any(a => a.m_Key == key))
|
||||||
.ToHashSet();
|
.ToHashSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,13 +154,13 @@ namespace ICD.Common.Attributes.Rpc
|
|||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
.GetCType()
|
.GetCType()
|
||||||
#else
|
#else
|
||||||
.GetTypeInfo()
|
.GetTypeInfo()
|
||||||
#endif
|
#endif
|
||||||
.GetProperties(BindingFlags.Public |
|
.GetProperties(BindingFlags.Public |
|
||||||
BindingFlags.NonPublic |
|
BindingFlags.NonPublic |
|
||||||
BindingFlags.Instance)
|
BindingFlags.Instance)
|
||||||
.Where(p => p.CanWrite && p.GetCustomAttributes<RpcAttribute>(true)
|
.Where(p => p.CanWrite && ReflectionExtensions.GetCustomAttributes<RpcAttribute>(p, true)
|
||||||
.Any(a => a.m_Key == key))
|
.Any(a => a.m_Key == key))
|
||||||
.ToHashSet();
|
.ToHashSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
#if SIMPLSHARP
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
#if SIMPLSHARP
|
||||||
using Crestron.SimplSharp.Reflection;
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
#else
|
||||||
|
using System.Reflection;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace ICD.Common.Utils.Extensions
|
namespace ICD.Common.Utils.Extensions
|
||||||
{
|
{
|
||||||
@@ -28,4 +31,3 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
Reference in New Issue
Block a user