コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void nodeCommandWithFixedReferenceFormat302() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void NodeCommandWithFixedReferenceFormat302()
        {
            // Given
            InMemoryClosableChannel channel = new InMemoryClosableChannel();
            NodeRecord before = new NodeRecord(42, true, false, 33, 99, 66);
            NodeRecord after  = new NodeRecord(42, true, false, 33, 99, 66);

            before.UseFixedReferences = true;
            after.UseFixedReferences  = true;

            (new Command.NodeCommand(before, after)).Serialize(channel);

            // When
            PhysicalLogCommandReaderV3_0_2 reader = new PhysicalLogCommandReaderV3_0_2();
            Command command = reader.Read(channel);

            assertTrue(command is Command.NodeCommand);

            Command.NodeCommand nodeCommand = (Command.NodeCommand)command;

            // Then
            assertEquals(before, nodeCommand.Before);
            assertEquals(after, nodeCommand.After);
            assertTrue(nodeCommand.Before.UseFixedReferences);
            assertTrue(nodeCommand.After.UseFixedReferences);
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void readRelationshipGroupCommandWithFixedReferenceFormat302() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ReadRelationshipGroupCommandWithFixedReferenceFormat302()
        {
            // Given
            InMemoryClosableChannel channel = new InMemoryClosableChannel();
            RelationshipGroupRecord before  = new RelationshipGroupRecord(42, 3);

            before.UseFixedReferences = true;
            RelationshipGroupRecord after = new RelationshipGroupRecord(42, 3, 4, 5, 6, 7, 8, true);

            after.UseFixedReferences = true;

            (new Command.RelationshipGroupCommand(before, after)).Serialize(channel);

            // When
            PhysicalLogCommandReaderV3_0_2 reader = new PhysicalLogCommandReaderV3_0_2();
            Command command = reader.Read(channel);

            assertTrue(command is Command.RelationshipGroupCommand);

            Command.RelationshipGroupCommand relationshipGroupCommand = (Command.RelationshipGroupCommand)command;

            // Then
            assertEquals(before, relationshipGroupCommand.Before);
            assertEquals(after, relationshipGroupCommand.After);
            assertTrue(relationshipGroupCommand.Before.UseFixedReferences);
            assertTrue(relationshipGroupCommand.After.UseFixedReferences);
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void readPropertyCommandWithFixedReferenceFormat302() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ReadPropertyCommandWithFixedReferenceFormat302()
        {
            InMemoryClosableChannel channel = new InMemoryClosableChannel();
            PropertyRecord          before  = new PropertyRecord(1);
            PropertyRecord          after   = new PropertyRecord(2);

            before.UseFixedReferences = true;
            after.UseFixedReferences  = true;

            (new Command.PropertyCommand(before, after)).Serialize(channel);

            PhysicalLogCommandReaderV3_0_2 reader = new PhysicalLogCommandReaderV3_0_2();
            Command command = reader.Read(channel);

            assertTrue(command is Command.PropertyCommand);

            Command.PropertyCommand neoStoreCommand = (Command.PropertyCommand)command;

            // Then
            assertEquals(before.NextProp, neoStoreCommand.Before.NextProp);
            assertEquals(after.NextProp, neoStoreCommand.After.NextProp);
            assertTrue(neoStoreCommand.Before.UseFixedReferences);
            assertTrue(neoStoreCommand.After.UseFixedReferences);
        }