//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void assertSerializeAndDeserializeConstraintRule(ConstraintRule constraintRule) throws org.neo4j.internal.kernel.api.exceptions.schema.MalformedSchemaRuleException
        private void AssertSerializeAndDeserializeConstraintRule(ConstraintRule constraintRule)
        {
            ConstraintRule deserialized = AssertConstraintRule(SerialiseAndDeserialise(constraintRule));

            assertThat(deserialized.Id, equalTo(constraintRule.Id));
            assertThat(deserialized.ConstraintDescriptor, equalTo(constraintRule.ConstraintDescriptor));
            assertThat(deserialized.Schema(), equalTo(constraintRule.Schema()));
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void assertParseRelationshipPropertyExistsRule(String serialized, String name) throws Exception
        private void AssertParseRelationshipPropertyExistsRule(string serialized, string name)
        {
            // GIVEN
            long ruleId      = 51;
            int  propertyKey = 6119;
            int  relTypeId   = 8512;
            ConstraintDescriptor constraint = ConstraintDescriptorFactory.existsForRelType(relTypeId, propertyKey);

            sbyte[] bytes = DecodeBase64(serialized);

            // WHEN
            ConstraintRule deserialized = AssertConstraintRule(SchemaRuleSerialization.Deserialize(ruleId, ByteBuffer.wrap(bytes)));

            // THEN
            assertThat(deserialized.Id, equalTo(ruleId));
            assertThat(deserialized.ConstraintDescriptor, equalTo(constraint));
            assertThat(deserialized.Schema(), equalTo(constraint.Schema()));
            assertException(deserialized.getOwnedIndex, typeof(System.InvalidOperationException));
            assertThat(deserialized.Name, @is(name));
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void assertParseNodeKeyConstraintRule(String serialized, String name) throws org.neo4j.internal.kernel.api.exceptions.schema.MalformedSchemaRuleException
        private void AssertParseNodeKeyConstraintRule(string serialized, string name)
        {
            // GIVEN
            long ruleId       = 1;
            int  propertyKey  = 3;
            int  labelId      = 55;
            long ownedIndexId = 2;
            NodeKeyConstraintDescriptor constraint = ConstraintDescriptorFactory.nodeKeyForLabel(labelId, propertyKey);

            sbyte[] bytes = DecodeBase64(serialized);

            // WHEN
            ConstraintRule deserialized = AssertConstraintRule(SchemaRuleSerialization.Deserialize(ruleId, ByteBuffer.wrap(bytes)));

            // THEN
            assertThat(deserialized.Id, equalTo(ruleId));
            assertThat(deserialized.ConstraintDescriptor, equalTo(constraint));
            assertThat(deserialized.Schema(), equalTo(constraint.Schema()));
            assertThat(deserialized.OwnedIndex, equalTo(ownedIndexId));
            assertThat(deserialized.Name, @is(name));
        }