Skip to content

Commit

Permalink
Merge pull request #35 from zmira/incoming
Browse files Browse the repository at this point in the history
upgrade LiteDB to v5.0.20 and other package dependencies
  • Loading branch information
mlockett42 authored Jun 26, 2024
2 parents 34cdae5 + 97b3d0c commit 52b5691
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion LiteDBAsync/ILiteRepositoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading.Tasks;
using LiteDB.Async;

namespace LiteDB.async
namespace LiteDB.Async
{
public interface ILiteRepositoryAsync : IDisposable
{
Expand Down
6 changes: 3 additions & 3 deletions LiteDBAsync/LiteDBAsync.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>LiteDB.Async</PackageId>
<Version>0.1.7</Version>
<Version>0.1.8</Version>
<Authors>Mark Lockett</Authors>
<TargetFramework>netstandard2.0</TargetFramework>
<Title>LiteDB-Async</Title>
Expand All @@ -14,11 +14,11 @@
<Summary>LiteDB.Async - A lightweight async wrapper for LiteDB</Summary>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>LiteDBAsyncStrongNameKey.snk</AssemblyOriginatorKeyFile>
<AssemblyName>LiteDB.Async</AssemblyName>
<AssemblyName>LiteDB.Async</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LiteDB" Version="5.0.17" />
<PackageReference Include="LiteDB" Version="5.0.20" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion LiteDBAsync/LiteRepositoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.IO;
using System.Linq.Expressions;
using System.Threading.Tasks;
using LiteDB.async;

namespace LiteDB.Async
{
Expand Down
12 changes: 6 additions & 6 deletions LiteDBAsyncTest/LiteDBAsyncTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.5.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0-preview-20220301-01" />
<PackageReference Include="Moq" Version="4.17.2" />
<PackageReference Include="xunit" Version="2.4.2-pre.12" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
41 changes: 23 additions & 18 deletions LiteDBAsyncTest/SimpleRepositoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,14 @@ public async Task UpsertAsyncList()


[Fact]
public async Task<Guid> InsertAsync()
public async Task InsertAsync()
{
var insertedPerson = await InsertPersonAsync();

var person = new SimplePerson()
{
FirstName = "John",
LastName = "Smith"
};

await _repo.InsertAsync(person);

var resultPerson = await _repo.SingleByIdAsync<SimplePerson>(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<SimplePerson>(insertedPerson.Id);
Assert.Equal(insertedPerson.Id, resultPerson.Id);
Assert.Equal(insertedPerson.FirstName, resultPerson.FirstName);
Assert.Equal(insertedPerson.LastName, resultPerson.LastName);
}


Expand All @@ -110,8 +102,8 @@ public async Task InsertAsyncList()
public async Task UpdateAsync()
{

var id = await InsertAsync();
var person = await _repo.FirstOrDefaultAsync<SimplePerson>(x=>x.Id==id);
var insertedPerson = await InsertPersonAsync();
var person = await _repo.FirstOrDefaultAsync<SimplePerson>(x => x.Id == insertedPerson.Id);

person.FirstName = "Hallo";
person.LastName = "Helga";
Expand Down Expand Up @@ -165,8 +157,8 @@ public async Task TestInsertingSameRecordTwiceRaisesException()
public async Task DeleteAsync()
{

var id = await InsertAsync();
var simplePerson = await _repo.SingleAsync<SimplePerson>(x=>x.Id==id);
var insertedPerson = await InsertPersonAsync();
var simplePerson = await _repo.SingleAsync<SimplePerson>(x => x.Id == insertedPerson.Id);
bool deleteResult = await _repo.DeleteAsync<SimplePerson>(simplePerson.Id);
deleteResult.Should().BeTrue();

Expand Down Expand Up @@ -221,5 +213,18 @@ private static List<SimplePerson> GetListOflist()
};
return list;
}

private async Task<SimplePerson> InsertPersonAsync()
{
var person = new SimplePerson()
{
FirstName = "John",
LastName = "Smith"
};

await _repo.InsertAsync(person);

return person;
}
}
}

0 comments on commit 52b5691

Please sign in to comment.