From e37acb53ab363dee0c3adb6a455ba8e90c768480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Mira?= Date: Fri, 7 Jun 2024 22:55:59 +0100 Subject: [PATCH 1/5] fix typo in namespace: `LiteDB.Async` vs. `LiteDB.async` --- LiteDBAsync/ILiteRepositoryAsync.cs | 2 +- LiteDBAsync/LiteRepositoryAsync.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/LiteDBAsync/ILiteRepositoryAsync.cs b/LiteDBAsync/ILiteRepositoryAsync.cs index 05ceeb4..08174a7 100644 --- a/LiteDBAsync/ILiteRepositoryAsync.cs +++ b/LiteDBAsync/ILiteRepositoryAsync.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using LiteDB.Async; -namespace LiteDB.async +namespace LiteDB.Async { public interface ILiteRepositoryAsync : IDisposable { diff --git a/LiteDBAsync/LiteRepositoryAsync.cs b/LiteDBAsync/LiteRepositoryAsync.cs index 61256bd..eb48d63 100644 --- a/LiteDBAsync/LiteRepositoryAsync.cs +++ b/LiteDBAsync/LiteRepositoryAsync.cs @@ -3,7 +3,6 @@ using System.IO; using System.Linq.Expressions; using System.Threading.Tasks; -using LiteDB.async; namespace LiteDB.Async { From 6fc5523bdb011e96160e5378c64aefbe3608181b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Mira?= Date: Fri, 7 Jun 2024 22:58:21 +0100 Subject: [PATCH 2/5] upgrade LiteDB to version 5.0.20 --- LiteDBAsync/LiteDBAsync.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LiteDBAsync/LiteDBAsync.csproj b/LiteDBAsync/LiteDBAsync.csproj index 2aa5bad..eef6732 100644 --- a/LiteDBAsync/LiteDBAsync.csproj +++ b/LiteDBAsync/LiteDBAsync.csproj @@ -14,11 +14,11 @@ LiteDB.Async - A lightweight async wrapper for LiteDB True LiteDBAsyncStrongNameKey.snk - LiteDB.Async + LiteDB.Async - + From 0299847e5445fd81631caa5fbcbffe79c9b45d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Mira?= Date: Fri, 7 Jun 2024 23:15:56 +0100 Subject: [PATCH 3/5] upgrade package dependencies + related fixes --- LiteDBAsyncTest/LiteDBAsyncTest.csproj | 12 ++++---- LiteDBAsyncTest/SimpleRepositoryTest.cs | 41 ++++++++++++++----------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/LiteDBAsyncTest/LiteDBAsyncTest.csproj b/LiteDBAsyncTest/LiteDBAsyncTest.csproj index a5e44d1..bd98cd1 100644 --- a/LiteDBAsyncTest/LiteDBAsyncTest.csproj +++ b/LiteDBAsyncTest/LiteDBAsyncTest.csproj @@ -9,15 +9,15 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/LiteDBAsyncTest/SimpleRepositoryTest.cs b/LiteDBAsyncTest/SimpleRepositoryTest.cs index 7c637ad..307bdfa 100644 --- a/LiteDBAsyncTest/SimpleRepositoryTest.cs +++ b/LiteDBAsyncTest/SimpleRepositoryTest.cs @@ -68,22 +68,14 @@ public async Task UpsertAsyncList() [Fact] - public async Task InsertAsync() + public async Task InsertAsyncAndTest() { + var insertedPerson = await InsertAsync(); - var person = new SimplePerson() - { - FirstName = "John", - LastName = "Smith" - }; - - await _repo.InsertAsync(person); - - var resultPerson = await _repo.SingleByIdAsync(person.Id); - Assert.Equal(person.Id, resultPerson.Id); - Assert.Equal(person.FirstName, resultPerson.FirstName); - Assert.Equal(person.LastName, resultPerson.LastName); - return resultPerson.Id; + var resultPerson = await _repo.SingleByIdAsync(insertedPerson.Id); + Assert.Equal(insertedPerson.Id, resultPerson.Id); + Assert.Equal(insertedPerson.FirstName, resultPerson.FirstName); + Assert.Equal(insertedPerson.LastName, resultPerson.LastName); } @@ -110,8 +102,8 @@ public async Task InsertAsyncList() public async Task UpdateAsync() { - var id = await InsertAsync(); - var person = await _repo.FirstOrDefaultAsync(x=>x.Id==id); + var insertedPerson = await InsertAsync(); + var person = await _repo.FirstOrDefaultAsync(x => x.Id == insertedPerson.Id); person.FirstName = "Hallo"; person.LastName = "Helga"; @@ -165,8 +157,8 @@ public async Task TestInsertingSameRecordTwiceRaisesException() public async Task DeleteAsync() { - var id = await InsertAsync(); - var simplePerson = await _repo.SingleAsync(x=>x.Id==id); + var insertedPerson = await InsertAsync(); + var simplePerson = await _repo.SingleAsync(x => x.Id == insertedPerson.Id); bool deleteResult = await _repo.DeleteAsync(simplePerson.Id); deleteResult.Should().BeTrue(); @@ -221,5 +213,18 @@ private static List GetListOflist() }; return list; } + + private async Task InsertAsync() + { + var person = new SimplePerson() + { + FirstName = "John", + LastName = "Smith" + }; + + await _repo.InsertAsync(person); + + return person; + } } } From 21d6f14baa417b95d084d52580dd1d98ada3521d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Mira?= Date: Fri, 7 Jun 2024 23:21:48 +0100 Subject: [PATCH 4/5] bump library version --- LiteDBAsync/LiteDBAsync.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LiteDBAsync/LiteDBAsync.csproj b/LiteDBAsync/LiteDBAsync.csproj index eef6732..6b9f187 100644 --- a/LiteDBAsync/LiteDBAsync.csproj +++ b/LiteDBAsync/LiteDBAsync.csproj @@ -1,7 +1,7 @@  LiteDB.Async - 0.1.7 + 0.1.8 Mark Lockett netstandard2.0 LiteDB-Async From 97b3d0ca69cdddddec307f1c92969d8b5b3d5025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Mira?= Date: Fri, 7 Jun 2024 23:26:15 +0100 Subject: [PATCH 5/5] revert test method name --- LiteDBAsyncTest/SimpleRepositoryTest.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LiteDBAsyncTest/SimpleRepositoryTest.cs b/LiteDBAsyncTest/SimpleRepositoryTest.cs index 307bdfa..c9ac6ac 100644 --- a/LiteDBAsyncTest/SimpleRepositoryTest.cs +++ b/LiteDBAsyncTest/SimpleRepositoryTest.cs @@ -68,9 +68,9 @@ public async Task UpsertAsyncList() [Fact] - public async Task InsertAsyncAndTest() + public async Task InsertAsync() { - var insertedPerson = await InsertAsync(); + var insertedPerson = await InsertPersonAsync(); var resultPerson = await _repo.SingleByIdAsync(insertedPerson.Id); Assert.Equal(insertedPerson.Id, resultPerson.Id); @@ -102,7 +102,7 @@ public async Task InsertAsyncList() public async Task UpdateAsync() { - var insertedPerson = await InsertAsync(); + var insertedPerson = await InsertPersonAsync(); var person = await _repo.FirstOrDefaultAsync(x => x.Id == insertedPerson.Id); person.FirstName = "Hallo"; @@ -157,7 +157,7 @@ public async Task TestInsertingSameRecordTwiceRaisesException() public async Task DeleteAsync() { - var insertedPerson = await InsertAsync(); + var insertedPerson = await InsertPersonAsync(); var simplePerson = await _repo.SingleAsync(x => x.Id == insertedPerson.Id); bool deleteResult = await _repo.DeleteAsync(simplePerson.Id); deleteResult.Should().BeTrue(); @@ -214,7 +214,7 @@ private static List GetListOflist() return list; } - private async Task InsertAsync() + private async Task InsertPersonAsync() { var person = new SimplePerson() {