Files
ResInsight/ApplicationLibCode/UnitTests/RimWorkflowVec3Binding-Test.cpp
T
Kristian Bendiksen f9030a3e1f Workflows: Add interactive editor for taskmaestro workflows
Build, copy and edit taskmaestro workflows in ResInsight and save them as
standard workflow.yaml + input.yaml.

- Python helper: catalog, load, save and export-registered subcommands,
  and run --registered for installed workflows
- C++ definition model with pure edit operations, port type checks,
  config field derivation, static validation and undo/redo
- Installed folder listing registered workflows (read-only, runnable,
  can be duplicated)
- Graph editor dock with task palette, drag-to-connect, context menus,
  automatic layout and debounced live validation
- New/Duplicate/Save/Save As/Rescan commands; unsaved edits run from a
  temporary folder and prompt before being discarded
- Update the design document and the user README
2026-10-21 11:19:35 +02:00

35 lines
1.4 KiB
C++

#include "gtest/gtest.h"
#include "RimWorkflowVec3Binding.h"
#include <QJsonObject>
//--------------------------------------------------------------------------------------------------
/// taskmaestro_resinsight.models.Vec3 is a plain pydantic model with x/y/z number fields, so both
/// the schema default and config_values represent it as a JSON object, not an array.
//--------------------------------------------------------------------------------------------------
TEST( RimWorkflowVec3Binding, AppliesObjectDefault )
{
RimWorkflowVec3Binding binding;
const QJsonObject schema{ { "name", "reference_point" },
{ "description", "Reference point" },
{ "required", true },
{ "default", QJsonObject{ { "x", 457196.0 }, { "y", 7322270.0 }, { "z", 2742.0 } } } };
binding.applySchema( schema );
const QJsonObject expected{ { "x", 457196.0 }, { "y", 7322270.0 }, { "z", 2742.0 } };
EXPECT_EQ( QJsonValue( expected ), binding.toJsonValue() );
}
//--------------------------------------------------------------------------------------------------
TEST( RimWorkflowVec3Binding, NoDefaultYieldsNull )
{
RimWorkflowVec3Binding binding;
const QJsonObject schema{ { "name", "reference_point" }, { "required", true } };
binding.applySchema( schema );
EXPECT_TRUE( binding.toJsonValue().isNull() );
}