internal static void TestParseUpdate(ITestPlatformSupport platform, String fileNameInit, String fileName, Action <mtest.IStructSix> updateDelegate) { mtest.StructSix_subscriber subs = new mtest.StructSix_subscriber(); //subs.debugOnlySetData(GetPublishableSix()); SimpleBuffer bufferInit = SimpleBuffer.readFromFile(fileNameInit); IPublishableParser parserInit = platform.makePublishableParser(bufferInit.getReadIterator()); subs.applyStateSyncMessage(parserInit); SimpleBuffer buffer = SimpleBuffer.readFromFile(fileName); IPublishableParser parser = platform.makePublishableParser(buffer.getReadIterator()); subs.applyMessageWithUpdates(parser); //mtest.StructSix actual = ( mtest.StructSix)subs.debugOnlyGetData(); mtest.StructSix expected = GetPublishableSix(); if (updateDelegate != null) { // not equal yet Assert.False(subs.isEquivalent(expected)); updateDelegate(expected); } Assert.True(subs.isEquivalent(expected)); }
internal static void TestParseStateSync(ITestPlatformSupport platform, String fileName) { mtest.StructSix_subscriber subs = new mtest.StructSix_subscriber(); SimpleBuffer buffer = SimpleBuffer.readFromFile(fileName); IPublishableParser parser = platform.makePublishableParser(buffer.getReadIterator()); subs.applyStateSyncMessage(parser); Assert.True(subs.isEquivalent(GetPublishableSix())); }