mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Tests: MessagePacking.GetId<T>
This commit is contained in:
parent
35be99c5d9
commit
7e0f649f59
@ -1,5 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using Mirror.Tests.MessageTests;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Mirror.Tests
|
namespace Mirror.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
@ -34,6 +37,16 @@ public static T UnpackFromByteArray<T>(byte[] data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// message id is generated from message.FullName.
|
||||||
|
// should be consistent across all platforms.
|
||||||
|
[Test]
|
||||||
|
public void GetId()
|
||||||
|
{
|
||||||
|
// "Mirror.Tests.MessageTests.TestMessage"
|
||||||
|
Debug.Log(typeof(TestMessage).FullName);
|
||||||
|
Assert.That(MessagePacking.GetId<TestMessage>(), Is.EqualTo(0x8706));
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestPacking()
|
public void TestPacking()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user