mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
test class name matches file name
This commit is contained in:
parent
5214b57db5
commit
dfffe26390
@ -13,7 +13,9 @@ public void NetworkBehaviourServer()
|
||||
{
|
||||
Assert.That(CompilationFinishedHook.WeaveFailed, Is.False);
|
||||
Assert.That(weaverErrors, Is.Empty);
|
||||
CheckAddedCodeServer();
|
||||
string networkServerGetActive = Weaver.NetworkServerGetActive.ToString();
|
||||
CheckAddedCode(networkServerGetActive, "MirrorTest.NetworkBehaviourServer", "ServerOnlyMethod");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -21,19 +23,8 @@ public void NetworkBehaviourClient()
|
||||
{
|
||||
Assert.That(CompilationFinishedHook.WeaveFailed, Is.False);
|
||||
Assert.That(weaverErrors, Is.Empty);
|
||||
CheckAddedCodeClient();
|
||||
}
|
||||
|
||||
static void CheckAddedCodeServer()
|
||||
{
|
||||
string networkServerGetActive = Weaver.NetworkServerGetActive.ToString();
|
||||
CheckAddedCode(networkServerGetActive, "ServerOnlyMethod");
|
||||
}
|
||||
|
||||
static void CheckAddedCodeClient()
|
||||
{
|
||||
string networkClientGetActive = Weaver.NetworkClientGetActive.ToString();
|
||||
CheckAddedCode(networkClientGetActive, "ClientOnlyMethod");
|
||||
CheckAddedCode(networkClientGetActive, "MirrorTest.NetworkBehaviourClient", "ClientOnlyMethod");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -41,10 +32,8 @@ static void CheckAddedCodeClient()
|
||||
/// </summary>
|
||||
/// <param name="addedString"></param>
|
||||
/// <param name="methodName"></param>
|
||||
static void CheckAddedCode(string addedString, string methodName)
|
||||
static void CheckAddedCode(string addedString, string className, string methodName)
|
||||
{
|
||||
string className = "MirrorTest.MirrorTestPlayer";
|
||||
|
||||
string assemblyName = Path.Combine(WeaverAssembler.OutputDirectory, WeaverAssembler.OutputFile);
|
||||
using (AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(assemblyName))
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
namespace MirrorTest
|
||||
{
|
||||
class MirrorTestPlayer : NetworkBehaviour
|
||||
class NetworkBehaviourClient : NetworkBehaviour
|
||||
{
|
||||
[Client]
|
||||
void ClientOnlyMethod()
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
namespace MirrorTest
|
||||
{
|
||||
class MirrorTestPlayer : NetworkBehaviour
|
||||
class NetworkBehaviourServer : NetworkBehaviour
|
||||
{
|
||||
[Server]
|
||||
void ServerOnlyMethod()
|
||||
|
Loading…
Reference in New Issue
Block a user