mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
adds test coverage for CustomAttribute (#1531)
This commit is contained in:
parent
3bc38d8938
commit
b440130647
67
Assets/Mirror/Tests/Editor/CustomAttrributeTest.cs
Normal file
67
Assets/Mirror/Tests/Editor/CustomAttrributeTest.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user