Test simplified

This commit is contained in:
vis2k 2021-10-09 14:58:24 +08:00
parent 512f60a3ef
commit 9dbd45c9d8

View File

@ -368,12 +368,10 @@ public void VirtualOverrideHook_HookCalledWhenSyncingChangedValue(bool intialSta
out _, out _, out VirtualOverrideHook serverObject, out _, out _, out VirtualOverrideHook serverObject,
out _, out _, out VirtualOverrideHook clientObject); out _, out _, out VirtualOverrideHook clientObject);
const int clientValue = 10;
const int serverValue = 24; const int serverValue = 24;
// change it on server // change it on server
serverObject.value = serverValue; serverObject.value = serverValue;
clientObject.value = clientValue;
// hook should change it on client // hook should change it on client
int overrideCallCount = 0; int overrideCallCount = 0;
@ -381,7 +379,7 @@ public void VirtualOverrideHook_HookCalledWhenSyncingChangedValue(bool intialSta
clientObject.OverrideHookCalled += (oldValue, newValue) => clientObject.OverrideHookCalled += (oldValue, newValue) =>
{ {
overrideCallCount++; overrideCallCount++;
Assert.That(oldValue, Is.EqualTo(clientValue)); Assert.That(oldValue, Is.EqualTo(0));
Assert.That(newValue, Is.EqualTo(serverValue)); Assert.That(newValue, Is.EqualTo(serverValue));
}; };
clientObject.BaseHookCalled += (oldValue, newValue) => clientObject.BaseHookCalled += (oldValue, newValue) =>