//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReadSomeCommands() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldReadSomeCommands() { // GIVEN InMemoryClosableChannel channel = new InMemoryClosableChannel(); Commands.CreateNode(0).serialize(channel); Commands.CreateNode(1).serialize(channel); Commands.CreateRelationshipTypeToken(0, 0).serialize(channel); Commands.CreateRelationship(0, 0, 1, 0).serialize(channel); Commands.CreatePropertyKeyToken(0, 0).serialize(channel); Commands.CreateProperty(0, PropertyType.SHORT_STRING, 0).serialize(channel); CommandReader reader = new PhysicalLogCommandReaderV3_0(); // THEN assertTrue(reader.Read(channel) is Command.NodeCommand); assertTrue(reader.Read(channel) is Command.NodeCommand); assertTrue(reader.Read(channel) is Command.RelationshipTypeTokenCommand); assertTrue(reader.Read(channel) is Command.RelationshipCommand); assertTrue(reader.Read(channel) is Command.PropertyKeyTokenCommand); assertTrue(reader.Read(channel) is Command.PropertyCommand); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void readRelationshipCommandWithNonRequiredSecondaryUnit() throws java.io.IOException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ReadRelationshipCommandWithNonRequiredSecondaryUnit() { InMemoryClosableChannel channel = new InMemoryClosableChannel(); RelationshipRecord before = new RelationshipRecord(42, true, 1, 2, 3, 4, 5, 6, 7, true, true); before.RequiresSecondaryUnit = false; before.SecondaryUnitId = 52; RelationshipRecord after = new RelationshipRecord(42, true, 1, 8, 3, 4, 5, 6, 7, true, true); (new Command.RelationshipCommand(before, after)).Serialize(channel); PhysicalLogCommandReaderV3_0 reader = new PhysicalLogCommandReaderV3_0(); Command command = reader.Read(channel); assertTrue(command is Command.RelationshipCommand); Command.RelationshipCommand relationshipCommand = (Command.RelationshipCommand)command; assertEquals(before, relationshipCommand.Before); VerifySecondaryUnit(before, relationshipCommand.Before); assertEquals(after, relationshipCommand.After); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReadRelationshipCommand() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldReadRelationshipCommand() { // Given InMemoryClosableChannel channel = new InMemoryClosableChannel(); RelationshipRecord before = new RelationshipRecord(42, -1, -1, -1); RelationshipRecord after = new RelationshipRecord(42, true, 1, 2, 3, 4, 5, 6, 7, true, true); (new Command.RelationshipCommand(before, after)).Serialize(channel); // When PhysicalLogCommandReaderV3_0 reader = new PhysicalLogCommandReaderV3_0(); Command command = reader.Read(channel); assertTrue(command is Command.RelationshipCommand); Command.RelationshipCommand relationshipCommand = (Command.RelationshipCommand)command; // Then assertEquals(before, relationshipCommand.Before); assertEquals(after, relationshipCommand.After); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void readRelationshipCommandWithFixedReferenceFormat300() throws java.io.IOException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ReadRelationshipCommandWithFixedReferenceFormat300() { InMemoryClosableChannel channel = new InMemoryClosableChannel(); RelationshipRecord before = new RelationshipRecord(42, true, 1, 2, 3, 4, 5, 6, 7, true, true); before.UseFixedReferences = true; RelationshipRecord after = new RelationshipRecord(42, true, 1, 8, 3, 4, 5, 6, 7, true, true); after.UseFixedReferences = true; (new Command.RelationshipCommand(before, after)).Serialize(channel); PhysicalLogCommandReaderV3_0 reader = new PhysicalLogCommandReaderV3_0(); Command command = reader.Read(channel); assertTrue(command is Command.RelationshipCommand); Command.RelationshipCommand relationshipCommand = (Command.RelationshipCommand)command; assertEquals(before, relationshipCommand.Before); assertTrue(relationshipCommand.Before.UseFixedReferences); assertEquals(after, relationshipCommand.After); assertTrue(relationshipCommand.After.UseFixedReferences); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void readPropertyCommandWithNonRequiredSecondaryUnit() throws java.io.IOException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ReadPropertyCommandWithNonRequiredSecondaryUnit() { InMemoryClosableChannel channel = new InMemoryClosableChannel(); PropertyRecord before = new PropertyRecord(1); PropertyRecord after = new PropertyRecord(2); after.RequiresSecondaryUnit = false; after.SecondaryUnitId = 78; (new Command.PropertyCommand(before, after)).Serialize(channel); PhysicalLogCommandReaderV3_0 reader = new PhysicalLogCommandReaderV3_0(); 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); VerifySecondaryUnit(after, neoStoreCommand.After); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReadNeoStoreCommand() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldReadNeoStoreCommand() { // Given InMemoryClosableChannel channel = new InMemoryClosableChannel(); NeoStoreRecord before = new NeoStoreRecord(); NeoStoreRecord after = new NeoStoreRecord(); after.NextProp = 42; (new Command.NeoStoreCommand(before, after)).Serialize(channel); // When PhysicalLogCommandReaderV3_0 reader = new PhysicalLogCommandReaderV3_0(); Command command = reader.Read(channel); assertTrue(command is Command.NeoStoreCommand); Command.NeoStoreCommand neoStoreCommand = (Command.NeoStoreCommand)command; // Then assertEquals(before.NextProp, neoStoreCommand.Before.NextProp); assertEquals(after.NextProp, neoStoreCommand.After.NextProp); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void readPropertyCommandWithFixedReferenceFormat300() throws java.io.IOException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ReadPropertyCommandWithFixedReferenceFormat300() { 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 reader = new PhysicalLogCommandReaderV3_0(); 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); }