You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The below unit test works in 5.0.17, but fails in 5.0.18.
I probably shouldn't be relying on Rebuild to dispose LiteDb and flush all pending writes to the stream, but our unit test does it this way and it breaks in 5.0.18 so I thought I would share.
Code to Reproduce
publicclassReOpen_Tests{[Fact]publicvoidShould_Open(){byte[]databaseBytes;using(varstream=newMemoryStream()){vardatabase=newLiteDatabase(stream);varcollection=database.GetCollection<Item>();collection.Upsert(newItem(Guid.NewGuid()));varitems=collection.Query().ToList();items.Should().HaveCount(1);database.Rebuild();databaseBytes=stream.ToArray();}// Opening the database with the existing stream should have the items still.using(varstream=newMemoryStream(databaseBytes)){vardatabase=newLiteDatabase(stream);varitems=database.GetCollection<Item>().Query().ToList();items.Should().HaveCount(1);}}privateclassItem{publicItem(Guidid){Id=id;}publicGuidId{get;set;}}}
Expected behavior
The test above should pass.
The text was updated successfully, but these errors were encountered:
Version
5.0.18
Describe the bug
The below unit test works in 5.0.17, but fails in 5.0.18.
I probably shouldn't be relying on Rebuild to dispose LiteDb and flush all pending writes to the stream, but our unit test does it this way and it breaks in 5.0.18 so I thought I would share.
Code to Reproduce
Expected behavior
The test above should pass.
The text was updated successfully, but these errors were encountered: