Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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()));
        }
        static void TestParseUpdate(ITestPlatformSupport platform, String fileNameInit, String fileName, Action <mtest.Ipublishable_seven> updateDelegate)
        {
            mtest.publishable_seven_subscriber subs = new mtest.publishable_seven_subscriber();
            //subs.debugOnlySetData(GetPublishableSeven());
            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.publishable_seven actual = (mtest.publishable_seven)subs.debugOnlyGetData();
            mtest.publishable_seven expected = GetPublishableSeven();

            Assert.False(expected.isEquivalent(subs));

            updateDelegate(expected);

            Assert.True(expected.isEquivalent(subs));
        }
        static void TestParseStateSync(ITestPlatformSupport platform, String fileName)
        {
            mtest.publishable_seven_subscriber subs = new mtest.publishable_seven_subscriber();

            SimpleBuffer       buffer = SimpleBuffer.readFromFile(fileName);
            IPublishableParser parser = platform.makePublishableParser(buffer.getReadIterator());

            subs.applyStateSyncMessage(parser);

            //mtest.publishable_seven actual = (mtest.publishable_seven)subs.debugOnlyGetData();
            mtest.publishable_seven expected = GetPublishableSeven();

            Assert.True(expected.isEquivalent(subs));
        }