Skip to content

Commit

Permalink
introduce test to ensure that changes can still be written after an a…
Browse files Browse the repository at this point in the history
…pplication restart
  • Loading branch information
hahn-kev committed Sep 12, 2024
1 parent 5508102 commit 59a1700
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/SIL.Harmony.Tests/DataModelSimpleChanges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ public async Task CanUpdateTheNoteField()
word.Note.Should().Be("a word note");
}

[Fact]
public async Task CanUpdateAWordAfterRestarting()
{
await WriteNextChange(SetWord(_entity1Id, "test-value"));
var instance2 = ForkDatabase();//creates new services, but copies database. Simulates restarting the application
await instance2.WriteNextChange(new SetWordNoteChange(_entity1Id, "a word note"));
var word = await instance2.DataModel.GetLatest<Word>(_entity1Id);
word!.Text.Should().Be("test-value");
word.Note.Should().Be("a word note");
}

[Fact]
public async Task WritingA2ndChangeDoesNotEffectTheFirstSnapshot()
{
Expand Down

0 comments on commit 59a1700

Please sign in to comment.