use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class EntityTypePropertyTest method whenAddingAnEntity_TheDirectTypeOfTheEntityIsTheTypeItWasCreatedFrom.
@Property
public void whenAddingAnEntity_TheDirectTypeOfTheEntityIsTheTypeItWasCreatedFrom(@NonMeta @NonAbstract EntityType type) {
Entity entity = type.addEntity();
assertEquals(type, entity.type());
}
use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class GraknTxPutPropertyTest method whenCallingPutRelationType_CreateATypeThatOwnsNoRoles.
@Property
public void whenCallingPutRelationType_CreateATypeThatOwnsNoRoles(@Open GraknTx graph, @Unused Label label) {
RelationshipType relationshipType = graph.putRelationshipType(label);
assertThat(relationshipType.relates().collect(toSet()), empty());
}
use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class GraknTxPutPropertyTest method whenCallingPutResourceTypeWithThePropertiesOfAnExistingResourceType_ItReturnsThatType.
@Property
public void whenCallingPutResourceTypeWithThePropertiesOfAnExistingResourceType_ItReturnsThatType(@Open GraknTx graph, @FromTx AttributeType<?> attributeType) {
assumeFalse(attributeType.equals(graph.admin().getMetaAttributeType()));
Label label = attributeType.getLabel();
AttributeType.DataType<?> dataType = attributeType.getDataType();
AttributeType<?> newType = graph.putAttributeType(label, dataType);
assertEquals(attributeType, newType);
}
use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class GraknTxPutPropertyTest method whenCallingPutRelationType_CreateATypeWithSuperTypeRelation.
@Property
public void whenCallingPutRelationType_CreateATypeWithSuperTypeRelation(@Open GraknTx tx, @Unused Label label) {
RelationshipType relationshipType = tx.putRelationshipType(label);
assertEquals(tx.admin().getMetaRelationType(), relationshipType.sup());
}
use of com.pholser.junit.quickcheck.Property in project grakn by graknlabs.
the class GraknTxPutPropertyTest method whenCallingPutRoleWithAnExistingRoleLabel_ItReturnsThatRole.
@Property
public void whenCallingPutRoleWithAnExistingRoleLabel_ItReturnsThatRole(@Open GraknTx graph, @FromTx Role role) {
Role newType = graph.putRole(role.getLabel());
assertEquals(role, newType);
}
Aggregations