use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class EntityTypePropertyTest method whenAddingAnEntity_TheEntityHasNoResources.
@Property
public void whenAddingAnEntity_TheEntityHasNoResources(@NonMeta @NonAbstract EntityType type) {
Entity entity = type.addEntity();
assertThat(entity.attributes().collect(toSet()), empty());
}
use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class EntityTypePropertyTest method whenAddingAnEntity_TheEntityIsInNoRelations.
@Property
public void whenAddingAnEntity_TheEntityIsInNoRelations(@NonMeta @NonAbstract EntityType type) {
Entity entity = type.addEntity();
assertThat(entity.relationships().collect(toSet()), empty());
}
use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class GraknTxPutPropertyTest method whenCallingPutEntityType_CreateATypeWithSuperTypeEntity.
@Property
public void whenCallingPutEntityType_CreateATypeWithSuperTypeEntity(@Open GraknTx graph, @Unused Label label) {
EntityType entityType = graph.putEntityType(label);
assertEquals(graph.admin().getMetaEntityType(), entityType.sup());
}
use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class GraknTxPutPropertyTest method whenCallingAnyPutSchemaConceptMethod_CreateAnOntologyConceptWithDefaultProperties.
@Property
public void whenCallingAnyPutSchemaConceptMethod_CreateAnOntologyConceptWithDefaultProperties(@Open GraknTx graph, @Unused Label label, @From(PutSchemaConceptFunctions.class) BiFunction<GraknTx, Label, SchemaConcept> putSchemaConcept) {
SchemaConcept concept = putSchemaConcept.apply(graph, label);
assertThat("Concept should only have one sub-type: itself", concept.subs().collect(toSet()), contains(concept));
assertFalse("Concept should not be implicit", concept.isImplicit());
assertThat("Rules of hypotheses should be empty", concept.getRulesOfHypothesis().collect(toSet()), empty());
assertThat("Rules of conclusion should be empty", concept.getRulesOfConclusion().collect(toSet()), empty());
}
use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class GraknTxPutPropertyTest method whenCallingAnyPutTypeMethod_CreateATypeWithDefaultProperties.
@Property
public void whenCallingAnyPutTypeMethod_CreateATypeWithDefaultProperties(@Open GraknTx graph, @Unused Label label, @From(PutTypeFunctions.class) BiFunction<GraknTx, Label, Type> putType) {
Type type = putType.apply(graph, label);
assertThat("Type should not play any roles", type.plays().collect(toSet()), empty());
assertFalse("Type should not be abstract", type.isAbstract());
}
Aggregations