use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class GraknTxPutPropertyTest method whenCallingPutRole_CreateARoleWithDefaultProperties.
@Property
public void whenCallingPutRole_CreateARoleWithDefaultProperties(@Open GraknTx graph, @Unused Label label) {
Role role = graph.putRole(label);
assertThat("The role should be played by no types", role.playedByTypes().collect(toSet()), empty());
assertThat("The role should be owned by no relation types", role.relationshipTypes().collect(toSet()), empty());
}
use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class GraknTxPutPropertyTest method whenCallingPutRelationTypeWithAnExistingRelationTypeLabel_ItReturnsThatType.
@Property
public void whenCallingPutRelationTypeWithAnExistingRelationTypeLabel_ItReturnsThatType(@Open GraknTx graph, @FromTx RelationshipType relationshipType) {
RelationshipType newType = graph.putRelationshipType(relationshipType.getLabel());
assertEquals(relationshipType, newType);
}
use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class GraknTxPutPropertyTest method whenCallingPutRule_CreateATypeWithSuperTypeRule.
@Property
public void whenCallingPutRule_CreateATypeWithSuperTypeRule(@Open GraknTx tx, @Unused Label label) {
Rule rule = tx.putRule(label, tx.graql().parser().parsePattern("$x"), tx.graql().parser().parsePattern("$x"));
assertEquals(tx.admin().getMetaRule(), rule.sup());
}
use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class SchemaConceptPropertyTest method whenASchemaElementHasADirectSuper_ItIsADirectSubOfThatSuper.
@Property
public void whenASchemaElementHasADirectSuper_ItIsADirectSubOfThatSuper(SchemaConcept schemaConcept) {
SchemaConcept superConcept = schemaConcept.sup();
assumeTrue(superConcept != null);
assertThat(PropertyUtil.directSubs(superConcept), hasItem(schemaConcept));
}
Aggregations