//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test(expected = IllegalArgumentException.class) public void constraintRuleNameMustNotBeTheEmptyString() public virtual void ConstraintRuleNameMustNotBeTheEmptyString() { //noinspection RedundantStringConstructorCall string name = ""; ConstraintRule.constraintRule(RULE_ID, ConstraintDescriptorFactory.existsForLabel(LABEL_ID, PROPERTY_ID_1), name); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void rulesCreatedWithNameMustRetainGivenNameAfterDeserialisation() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void RulesCreatedWithNameMustRetainGivenNameAfterDeserialisation() { string name = "custom_rule"; assertThat(SerialiseAndDeserialise(NamedForLabel(name, LABEL_ID, PROPERTY_ID_1).withId(RULE_ID)).Name, @is(name)); assertThat(SerialiseAndDeserialise(NamedUniqueForLabel(name, LABEL_ID, PROPERTY_ID_1).withIds(RULE_ID_2, RULE_ID)).Name, @is(name)); assertThat(SerialiseAndDeserialise(NamedForLabel(name, LABEL_ID, PROPERTY_ID_1, PROPERTY_ID_2).withId(RULE_ID)).Name, @is(name)); assertThat(SerialiseAndDeserialise(NamedUniqueForLabel(name, LABEL_ID, PROPERTY_ID_1, PROPERTY_ID_2).withIds(RULE_ID_2, RULE_ID)).Name, @is(name)); assertThat(SerialiseAndDeserialise(NamedForLabel(name, LABEL_ID, IntStream.range(1, 200).toArray()).withId(RULE_ID)).Name, @is(name)); assertThat(SerialiseAndDeserialise(ConstraintRule.constraintRule(RULE_ID, ConstraintDescriptorFactory.existsForLabel(LABEL_ID, PROPERTY_ID_1), name)).Name, @is(name)); assertThat(SerialiseAndDeserialise(ConstraintRule.ConstraintRuleConflict(RULE_ID_2, ConstraintDescriptorFactory.uniqueForLabel(LABEL_ID, PROPERTY_ID_1), RULE_ID, name)).Name, @is(name)); assertThat(SerialiseAndDeserialise(ConstraintRule.ConstraintRuleConflict(RULE_ID_2, ConstraintDescriptorFactory.nodeKeyForLabel(LABEL_ID, PROPERTY_ID_1), RULE_ID, name)).Name, @is(name)); assertThat(SerialiseAndDeserialise(ConstraintRule.constraintRule(RULE_ID_2, ConstraintDescriptorFactory.existsForRelType(REL_TYPE_ID, PROPERTY_ID_1), name)).Name, @is(name)); assertThat(SerialiseAndDeserialise(ConstraintRule.constraintRule(RULE_ID, ConstraintDescriptorFactory.existsForLabel(LABEL_ID, PROPERTY_ID_1, PROPERTY_ID_2), name)).Name, @is(name)); assertThat(SerialiseAndDeserialise(ConstraintRule.constraintRule(RULE_ID_2, ConstraintDescriptorFactory.existsForRelType(REL_TYPE_ID, PROPERTY_ID_1, PROPERTY_ID_2), name)).Name, @is(name)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void rulesCreatedWithNullNameMustRetainComputedNameAfterDeserialisation() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void RulesCreatedWithNullNameMustRetainComputedNameAfterDeserialisation() { assertThat(SerialiseAndDeserialise(ForLabel(LABEL_ID, PROPERTY_ID_1).withId(RULE_ID)).Name, @is("index_1")); assertThat(SerialiseAndDeserialise(UniqueForLabel(LABEL_ID, PROPERTY_ID_1).withIds(RULE_ID_2, RULE_ID)).Name, @is("index_2")); assertThat(SerialiseAndDeserialise(ForLabel(LABEL_ID, PROPERTY_ID_1, PROPERTY_ID_2).withId(RULE_ID)).Name, @is("index_1")); assertThat(SerialiseAndDeserialise(UniqueForLabel(LABEL_ID, PROPERTY_ID_1, PROPERTY_ID_2).withIds(RULE_ID_2, RULE_ID)).Name, @is("index_2")); assertThat(SerialiseAndDeserialise(ForLabel(LABEL_ID, IntStream.range(1, 200).toArray()).withId(RULE_ID)).Name, @is("index_1")); string name = null; assertThat(SerialiseAndDeserialise(ConstraintRule.constraintRule(RULE_ID, ConstraintDescriptorFactory.existsForLabel(LABEL_ID, PROPERTY_ID_1), name)).Name, @is("constraint_1")); assertThat(SerialiseAndDeserialise(ConstraintRule.ConstraintRuleConflict(RULE_ID_2, ConstraintDescriptorFactory.uniqueForLabel(LABEL_ID, PROPERTY_ID_1), RULE_ID, name)).Name, @is("constraint_2")); assertThat(SerialiseAndDeserialise(ConstraintRule.ConstraintRuleConflict(RULE_ID_2, ConstraintDescriptorFactory.nodeKeyForLabel(LABEL_ID, PROPERTY_ID_1), RULE_ID, name)).Name, @is("constraint_2")); assertThat(SerialiseAndDeserialise(ConstraintRule.constraintRule(RULE_ID_2, ConstraintDescriptorFactory.existsForRelType(REL_TYPE_ID, PROPERTY_ID_1), name)).Name, @is("constraint_2")); assertThat(SerialiseAndDeserialise(ConstraintRule.constraintRule(RULE_ID, ConstraintDescriptorFactory.existsForLabel(LABEL_ID, PROPERTY_ID_1, PROPERTY_ID_2), name)).Name, @is("constraint_1")); assertThat(SerialiseAndDeserialise(ConstraintRule.constraintRule(RULE_ID_2, ConstraintDescriptorFactory.existsForRelType(REL_TYPE_ID, PROPERTY_ID_1, PROPERTY_ID_2), name)).Name, @is("constraint_2")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test(expected = IllegalArgumentException.class) public void constraintRuleNameMustNotContainNullCharacter() public virtual void ConstraintRuleNameMustNotContainNullCharacter() { string name = "a\0b"; ConstraintRule.constraintRule(RULE_ID, ConstraintDescriptorFactory.existsForLabel(LABEL_ID, PROPERTY_ID_1), name); }