Skip to content

Commit

Permalink
Corrected config name and restored dynamic access tests
Browse files Browse the repository at this point in the history
  • Loading branch information
papafe committed Jul 25, 2024
1 parent d5f5b2c commit 819b9aa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions Tests/Realm.Tests/Database/DynamicAccessTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,16 @@ public void GetEmbeddedObjectProperty_WhenCastToRealmObject_Throws()
});
}

[Test]
public void GetProperty_WhenPropertyIsMissing_Throws()
{
RunTestInAllModes((realm, _) =>
{
var allTypesObject = realm.Write(() => realm.DynamicApi.CreateObject(nameof(AllTypesObject)));
Assert.Throws<MissingMemberException>(() => allTypesObject.DynamicApi.Get<string>("idontexist"));
});
}

[Test]
public void GetProperty_WhenPropertyIsBacklinks_Throws()
{
Expand Down Expand Up @@ -554,6 +564,19 @@ public void SetProperty_WhenUsingConvertibleType_Succeeds()
});
}

[Test]
public void SetProperty_WhenPropertyIsMissing_Throws()
{
RunTestInAllModes((realm, _) =>
{
realm.Write(() =>
{
var ato = realm.DynamicApi.CreateObject(nameof(AllTypesObject));
Assert.Throws<MissingMemberException>(() => ato.DynamicApi.Set("idontexist", "foo"));
});
});
}

[Test]
public void SetProperty_WhenPropertyIsBacklinks_Throws()
{
Expand Down
2 changes: 1 addition & 1 deletion wrappers/src/shared_realm_cs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ REALM_EXPORT SharedRealm* shared_realm_open(Configuration configuration, NativeE
Realm::Config config = get_shared_realm_config(configuration);
config.in_memory = configuration.in_memory;
config.automatically_handle_backlinks_in_migrations = configuration.automatically_migrate_embedded;
config.flexible_schema = configuration.flexible_schema;
config.flexible_schema = configuration.relaxed_schema;

if (configuration.read_only) {
config.schema_mode = SchemaMode::Immutable;
Expand Down
2 changes: 1 addition & 1 deletion wrappers/src/shared_realm_cs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct Configuration

bool automatically_migrate_embedded;

bool flexible_schema;
bool relaxed_schema;
};

struct SyncConfiguration
Expand Down

0 comments on commit 819b9aa

Please sign in to comment.