mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
Additional test stubs
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
namespace ICD.Common.Utils.Tests.Attributes
|
||||||
|
{
|
||||||
|
public abstract class AbstractIcdAttributeTest
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace ICD.Common.Utils.Tests.Attributes
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public sealed class KrangPluginAttributeTest : AbstractIcdAttributeTest
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
55
ICD.Common.Utils.Tests/Attributes/Rpc/RpcAttributeTest.cs
Normal file
55
ICD.Common.Utils.Tests/Attributes/Rpc/RpcAttributeTest.cs
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using ICD.Common.Utils.Attributes.Rpc;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace ICD.Common.Utils.Tests.Attributes.Rpc
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public sealed class RpcAttributeTest : AbstractIcdAttributeTest
|
||||||
|
{
|
||||||
|
private class TestClass
|
||||||
|
{
|
||||||
|
[Rpc("A")]
|
||||||
|
public int TestProperty { get; set; }
|
||||||
|
|
||||||
|
[Rpc("A")]
|
||||||
|
public void TestMethod()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[Rpc("B")]
|
||||||
|
public void TestMethod(int a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[Rpc("C")]
|
||||||
|
public void TestMethod(int a, string b)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void GetMethodTest()
|
||||||
|
{
|
||||||
|
TestClass instance = new TestClass();
|
||||||
|
|
||||||
|
Assert.NotNull(RpcAttribute.GetMethod(instance, "A", new object[] { }));
|
||||||
|
Assert.Null(RpcAttribute.GetMethod(instance, "B", new object[] { }));
|
||||||
|
Assert.NotNull(RpcAttribute.GetMethod(instance, "B", new object[] { 1 }));
|
||||||
|
Assert.NotNull(RpcAttribute.GetMethod(instance, "C", new object[] { 1, null }));
|
||||||
|
Assert.NotNull(RpcAttribute.GetMethod(instance, "C", new object[] { 1, "test" }));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void GetPropertyTest()
|
||||||
|
{
|
||||||
|
TestClass instance = new TestClass();
|
||||||
|
|
||||||
|
Assert.NotNull(RpcAttribute.GetProperty(instance, "A", "test"));
|
||||||
|
Assert.NotNull(RpcAttribute.GetProperty(instance, "A", null));
|
||||||
|
Assert.Null(RpcAttribute.GetProperty(instance, "B", "test"));
|
||||||
|
Assert.Null(RpcAttribute.GetProperty(instance, "B", 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using ICD.Common.Utils.EventArguments;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace ICD.Common.Utils.Tests.EventArguments
|
||||||
|
{
|
||||||
|
public abstract class GenericEventArgsTest
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public abstract void DataTest();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user