adds test coverage for CustomAttribute (#1531)

This commit is contained in:
uwee 2020-03-01 05:13:48 -05:00 committed by GitHub
parent 3bc38d8938
commit b440130647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,67 @@
using NUnit.Framework;
namespace Mirror.Tests
{
public class CustomAttrributeTest
{
[Test]
public void SyncVarAttributeTest()
{
SyncVarAttribute attrib = new SyncVarAttribute();
Assert.That(string.IsNullOrEmpty(attrib.hook));
attrib.hook = "foo";
Assert.That(attrib.hook.Equals("foo"));
}
[Test]
public void CommandAttributeTest()
{
CommandAttribute attrib = new CommandAttribute();
Assert.That(attrib.channel == 0);
attrib.channel = 1;
Assert.That(attrib.channel == 1);
}
[Test]
public void ClientRPCAttributeTest()
{
ClientRpcAttribute attrib = new ClientRpcAttribute();
Assert.That(attrib.channel == 0);
attrib.channel = 1;
Assert.That(attrib.channel == 1);
}
[Test]
public void TargetRPCAttributeTest()
{
TargetRpcAttribute attrib = new TargetRpcAttribute();
Assert.That(attrib.channel == 0);
attrib.channel = 1;
Assert.That(attrib.channel == 1);
}
[Test]
public void SyncEventAttributeTest()
{
SyncEventAttribute attrib = new SyncEventAttribute();
Assert.That(attrib.channel == 0);
attrib.channel = 1;
Assert.That(attrib.channel == 1);
}
}
}