Skip to content

Commit

Permalink
Basic test passing [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
papafe committed Jun 18, 2024
1 parent 38a9800 commit 7695a8c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
13 changes: 6 additions & 7 deletions Tests/Realm.Tests/Database/DynamicAccessTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -983,20 +983,19 @@ public void GetDictionary_WhenCastToWrongValue_Throws()
[Test]
public void FlexibleSchema_BaseTest()
{
var person = _realm.Write(() =>
var testObj = _realm.Write(() =>
{
return _realm.Add(new Person());
return _realm.Add(new IntPropertyObject());
});

_realm.Write(() =>
{
person.DynamicApi.Set("prop1", "testval");
person.DynamicApi.Set("prop2", 10);

testObj.DynamicApi.Set("prop1", "testval");
testObj.DynamicApi.Set("prop2", 10);
});

Assert.That(person.DynamicApi.Get<string>("prop1"), Is.EqualTo("testval"));
Assert.That(person.DynamicApi.Get<int>("prop2"), Is.EqualTo(10));
Assert.That(testObj.DynamicApi.Get<string>("prop1"), Is.EqualTo("testval"));
Assert.That(testObj.DynamicApi.Get<int>("prop2"), Is.EqualTo(10));
}

#endregion
Expand Down
1 change: 1 addition & 0 deletions wrappers/src/shared_realm_cs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +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 = true;

if (configuration.read_only) {
config.schema_mode = SchemaMode::Immutable;
Expand Down

0 comments on commit 7695a8c

Please sign in to comment.