Skip to content
Snippets Groups Projects
Commit 58940216 authored by florian's avatar florian
Browse files

ENH: Add HasWarnings

parent cfa12f94
No related branches found
No related tags found
1 merge request!4ENH: Allow insertion and deletion of single entities
Pipeline #11094 passed
Pipeline: caosdb-cppinttest

#11096

    This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
    ......@@ -326,6 +326,9 @@ public:
    [[nodiscard]] auto GetWarnings() const -> const Messages & {
    return warnings;
    }
    [[nodiscard]] inline auto HasWarnings() const -> bool {
    return this->warnings.wrapped->size() > 0;
    }
    [[nodiscard]] auto GetInfos() const -> const Messages & { return infos; }
    inline auto ToString() const -> const std::string {
    ......
    ......@@ -85,6 +85,7 @@ TEST(test_entity, test_from_id_response) { // NOLINT
    std::cout << entity.ToString() << std::endl;
    EXPECT_EQ(entity.GetId(), "entity_id");
    EXPECT_TRUE(entity.HasErrors());
    EXPECT_EQ(entity.GetErrors().Size(), 1);
    EXPECT_EQ(entity.GetErrors().At(0).GetDescription(), "error_desc");
    EXPECT_EQ(entity.GetErrors().At(0).GetCode(),
    ......@@ -103,6 +104,7 @@ TEST(test_entity, test_from_id_response) { // NOLINT
    EXPECT_EQ(other_ent.GetId(), "other_entity_id");
    EXPECT_EQ(other_ent.GetWarnings().Size(), 1);
    EXPECT_TRUE(other_ent.HasWarnings());
    EXPECT_EQ(other_ent.GetWarnings().At(0).GetDescription(), "warning_desc");
    EXPECT_EQ(other_ent.GetWarnings().At(0).GetCode(),
    MessageCode::ENTITY_HAS_NO_PROPERTIES);
    ......
    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