diff --git a/Assets/Mirror/Tests/Editor/SyncDictionaryTest.cs b/Assets/Mirror/Tests/Editor/SyncDictionaryTest.cs index 4075a1a4b..e3ff7a5e8 100644 --- a/Assets/Mirror/Tests/Editor/SyncDictionaryTest.cs +++ b/Assets/Mirror/Tests/Editor/SyncDictionaryTest.cs @@ -7,10 +7,8 @@ namespace Mirror.Tests [TestFixture] public class SyncDictionaryTest { - public class SyncDictionaryIntString : SyncDictionary {} - - SyncDictionaryIntString serverSyncDictionary; - SyncDictionaryIntString clientSyncDictionary; + SyncDictionary serverSyncDictionary; + SyncDictionary clientSyncDictionary; void SerializeAllTo(T fromList, T toList) where T : SyncObject { @@ -32,8 +30,8 @@ void SerializeDeltaTo(T fromList, T toList) where T : SyncObject [SetUp] public void SetUp() { - serverSyncDictionary = new SyncDictionaryIntString(); - clientSyncDictionary = new SyncDictionaryIntString(); + serverSyncDictionary = new SyncDictionary(); + clientSyncDictionary = new SyncDictionary(); // add some data to the list serverSyncDictionary.Add(0, "Hello"); @@ -69,7 +67,7 @@ public void TestClear() { serverSyncDictionary.Clear(); SerializeDeltaTo(serverSyncDictionary, clientSyncDictionary); - Assert.That(serverSyncDictionary, Is.EquivalentTo(new SyncDictionaryIntString())); + Assert.That(serverSyncDictionary, Is.EquivalentTo(new SyncDictionary())); } [Test] @@ -156,7 +154,7 @@ public void CallbackTest() { called = true; - Assert.That(op, Is.EqualTo(SyncDictionaryIntString.Operation.OP_ADD)); + Assert.That(op, Is.EqualTo(SyncDictionary.Operation.OP_ADD)); Assert.That(index, Is.EqualTo(3)); Assert.That(item, Is.EqualTo("yay")); Assert.That(clientSyncDictionary[index], Is.EqualTo("yay")); @@ -175,7 +173,7 @@ public void ServerCallbackTest() { called = true; - Assert.That(op, Is.EqualTo(SyncDictionaryIntString.Operation.OP_ADD)); + Assert.That(op, Is.EqualTo(SyncDictionary.Operation.OP_ADD)); Assert.That(index, Is.EqualTo(3)); Assert.That(item, Is.EqualTo("yay")); Assert.That(serverSyncDictionary[index], Is.EqualTo("yay")); @@ -191,7 +189,7 @@ public void CallbackRemoveTest() clientSyncDictionary.Callback += (op, key, item) => { called = true; - Assert.That(op, Is.EqualTo(SyncDictionaryIntString.Operation.OP_REMOVE)); + Assert.That(op, Is.EqualTo(SyncDictionary.Operation.OP_REMOVE)); Assert.That(item, Is.EqualTo("World")); }; serverSyncDictionary.Remove(1); @@ -294,8 +292,8 @@ public void ObjectCanBeReusedAfterReset() clientSyncDictionary.Reset(); // make old client the host - SyncDictionaryIntString hostList = clientSyncDictionary; - SyncDictionaryIntString clientList2 = new SyncDictionaryIntString(); + SyncDictionary hostList = clientSyncDictionary; + SyncDictionary clientList2 = new SyncDictionary(); Assert.That(hostList.IsReadOnly, Is.False); diff --git a/Assets/Mirror/Tests/Editor/SyncSetTest.cs b/Assets/Mirror/Tests/Editor/SyncSetTest.cs index 23f648569..fe80269be 100644 --- a/Assets/Mirror/Tests/Editor/SyncSetTest.cs +++ b/Assets/Mirror/Tests/Editor/SyncSetTest.cs @@ -7,10 +7,8 @@ namespace Mirror.Tests [TestFixture] public class SyncSetTest { - public class SyncSetString : SyncHashSet {} - - SyncSetString serverSyncSet; - SyncSetString clientSyncSet; + SyncHashSet serverSyncSet; + SyncHashSet clientSyncSet; void SerializeAllTo(T fromList, T toList) where T : SyncObject { @@ -32,8 +30,8 @@ void SerializeDeltaTo(T fromList, T toList) where T : SyncObject [SetUp] public void SetUp() { - serverSyncSet = new SyncSetString(); - clientSyncSet = new SyncSetString(); + serverSyncSet = new SyncHashSet(); + clientSyncSet = new SyncHashSet(); // add some data to the list serverSyncSet.Add("Hello"); @@ -99,7 +97,7 @@ public void CallbackTest() { called = true; - Assert.That(op, Is.EqualTo(SyncSetString.Operation.OP_ADD)); + Assert.That(op, Is.EqualTo(SyncHashSet.Operation.OP_ADD)); Assert.That(item, Is.EqualTo("yay")); }; @@ -118,7 +116,7 @@ public void CallbackRemoveTest() { called = true; - Assert.That(op, Is.EqualTo(SyncSetString.Operation.OP_REMOVE)); + Assert.That(op, Is.EqualTo(SyncHashSet.Operation.OP_REMOVE)); Assert.That(item, Is.EqualTo("World")); }; serverSyncSet.Remove("World"); @@ -263,8 +261,8 @@ public void ObjectCanBeReusedAfterReset() clientSyncSet.Reset(); // make old client the host - SyncSetString hostList = clientSyncSet; - SyncSetString clientList2 = new SyncSetString(); + SyncHashSet hostList = clientSyncSet; + SyncHashSet clientList2 = new SyncHashSet(); Assert.That(hostList.IsReadOnly, Is.False);