Skip to content
Snippets Groups Projects
Verified Commit b8e2679f authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Merge branch 'f-insert' into f-multi-retrieve

parents aa579a7e 7b512690
No related branches found
No related tags found
1 merge request!4F multi retrieve
Pipeline #11127 failed
......@@ -118,6 +118,10 @@ TEST(test_transaction, insert_delete) {
const auto &new_entity = insert_result_set.GetEntity();
EXPECT_FALSE(new_entity.GetId().empty());
EXPECT_FALSE(new_entity.HasErrors());
// Should have a warning since it has no properties
EXPECT_TRUE(new_entity.HasWarnings());
EXPECT_EQ(new_entity.GetWarnings().Size(), 1);
EXPECT_EQ(new_entity.GetWarnings().At(0).GetCode(), MessageCode::ENTITY_HAS_NO_PROPERTIES);
auto delete_transaction(connection->CreateTransaction());
......@@ -166,4 +170,28 @@ TEST(test_transaction, test_multi_retrieve) {
MessageCode::ENTITY_DOES_NOT_EXIST);
}
// TODO(fspreck) Insert an RT and a Record of this type, check
// whether this is reflected correctly in the inserted Record, then
// delete everything.
TEST(test_transaction, insert_delete_with_parent) {
const auto &connection =
caosdb::connection::ConnectionManager::GetDefaultConnection();
auto insert_transaction(connection->CreateTransaction());
Entity entity;
entity.SetRole("RecordType");
entity.SetName("RT1");
insert_transaction->InsertEntity(&entity);
insert_transaction->ExecuteAsynchronously();
auto insert_status = insert_transaction->WaitForIt();
ASSERT_TRUE(insert_status.IsTerminated());
ASSERT_FALSE(insert_status.IsError());
}
// TODO(fspreck) Insert a Record with a parent and a Property. Check
// for success and delete everything.
} // namespace caosdb::transaction
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment