diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 31607fa..009d6c1 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,7 +16,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore - name: Build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d097fb6..c71e59f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Build run: dotnet build - name: Pack diff --git a/RqliteDotnet.Test/DtoTests.cs b/RqliteDotnet.Test/DtoTests.cs index 9f9f106..c93a255 100644 --- a/RqliteDotnet.Test/DtoTests.cs +++ b/RqliteDotnet.Test/DtoTests.cs @@ -11,8 +11,8 @@ public void QueryParameterSerialization_Works() var qNum = new QueryParameter() { Value = 10, ParamType = QueryParamType.Number }; var qpStr = new QueryParameter() { Value = "Alexander", ParamType = QueryParamType.String }; - Assert.AreEqual("10", qNum.ToParamString()); - Assert.AreEqual("\"Alexander\"", qpStr.ToParamString()); + Assert.That(qNum.ToParamString(), Is.EqualTo("10")); + Assert.That(qpStr.ToParamString(), Is.EqualTo("\"Alexander\"")); } [Test] @@ -21,7 +21,7 @@ public void NamedQueryParameterSerialization_Works() var qNum = new NamedQueryParameter() {Name = "age", Value = 10, ParamType = QueryParamType.Number }; var qStr = new NamedQueryParameter() {Name = "name", Value = "Alexander", ParamType = QueryParamType.String }; - Assert.AreEqual("\"age\":10", qNum.ToParamString()); - Assert.AreEqual("\"name\":\"Alexander\"", qStr.ToParamString()); + Assert.That(qNum.ToParamString(), Is.EqualTo("\"age\":10")); + Assert.That(qStr.ToParamString(), Is.EqualTo("\"name\":\"Alexander\"")); } } \ No newline at end of file diff --git a/RqliteDotnet.Test/RqliteClientTests.cs b/RqliteDotnet.Test/RqliteClientTests.cs index 5c56c14..24ec09d 100644 --- a/RqliteDotnet.Test/RqliteClientTests.cs +++ b/RqliteDotnet.Test/RqliteClientTests.cs @@ -14,12 +14,12 @@ public async Task BasicQuery_Works() var rqClient = new RqliteClient("http://localhost:6000", client); var queryresult = await rqClient.Query("select * from foo"); - Assert.AreEqual(1, queryresult.Results.Count); - Assert.AreEqual(2, queryresult.Results[0].Columns.Count); - Assert.AreEqual("id", queryresult.Results[0].Columns[0]); - Assert.AreEqual("name", queryresult.Results[0].Columns[1]); - Assert.AreEqual(2, queryresult.Results[0].Types.Count); - Assert.AreEqual(1, queryresult.Results[0].Values.Count); + Assert.That(queryresult!.Results!.Count, Is.EqualTo(1)); + Assert.That(queryresult!.Results[0]!.Columns!.Count, Is.EqualTo(2)); + Assert.That(queryresult.Results[0].Columns[0], Is.EqualTo("id")); + Assert.That(queryresult.Results[0].Columns[1], Is.EqualTo("name")); + Assert.That(queryresult!.Results[0]!.Types!.Count, Is.EqualTo(2)); + Assert.That(queryresult!.Results[0]!.Values!.Count, Is.EqualTo(1)); } [Test] @@ -30,9 +30,9 @@ public async Task QueryWithGenerics_Works() var rqClient = new RqliteOrmClient("http://localhost:6000", client); var queryresults = await rqClient.Query("select * from foo"); - Assert.AreEqual(1, queryresults.Count); - Assert.AreEqual(1, queryresults[0].Id); - Assert.AreEqual("john", queryresults[0].Name); + Assert.That(queryresults.Count, Is.EqualTo(1)); + Assert.That(queryresults[0].Id, Is.EqualTo(1)); + Assert.That(queryresults[0].Name, Is.EqualTo("john")); } [Test] @@ -49,9 +49,9 @@ public async Task ParametrizedQueryWithGenerics_Works() Value = "john" }); - Assert.AreEqual(1, queryresults.Count); - Assert.AreEqual(1, queryresults[0].Id); - Assert.AreEqual("john", queryresults[0].Name); + Assert.That(queryresults.Count, Is.EqualTo(1)); + Assert.That(queryresults[0].Id, Is.EqualTo(1)); + Assert.That(queryresults[0].Name, Is.EqualTo("john")); } [Test] @@ -62,9 +62,9 @@ public async Task BasicExecute_Works() var rqClient = new RqliteClient("http://localhost:6000", client); var result = await rqClient.Execute("create table newfoo (id integer primary key not null)"); - Assert.AreEqual(1, result.Results.Count); - Assert.AreEqual(1, result.Results[0].RowsAffected); - Assert.AreEqual(2, result.Results[0].LastInsertId); + Assert.That(result!.Results!.Count, Is.EqualTo(1)); + Assert.That(result.Results[0].RowsAffected, Is.EqualTo(1)); + Assert.That(result.Results[0].LastInsertId, Is.EqualTo(2)); } [Test] @@ -81,9 +81,9 @@ public async Task ParametrizedExecute_Works() } )}, DbFlag.Transaction); - Assert.AreEqual(1, result.Results.Count); - Assert.AreEqual(1, result.Results[0].RowsAffected); - Assert.AreEqual(2, result.Results[0].LastInsertId); + Assert.That(result!.Results!.Count, Is.EqualTo(1)); + Assert.That(result.Results[0].RowsAffected, Is.EqualTo(1)); + Assert.That(result.Results[0].LastInsertId, Is.EqualTo(2)); } [Test] @@ -97,8 +97,8 @@ public async Task BasicQueryParam_Works() ParamType = QueryParamType.String, Value = "john" }); - Assert.AreEqual(1, result.Results.Count); - Assert.AreEqual(2, result.Results[0].Values[0].Count); + Assert.That(result!.Results!.Count, Is.EqualTo(1)); + Assert.That(result!.Results[0]!.Values[0]!.Count, Is.EqualTo(2)); } } diff --git a/RqliteDotnet.Test/RqliteDotnet.Test.csproj b/RqliteDotnet.Test/RqliteDotnet.Test.csproj index 3b2d2f0..2d6c89d 100644 --- a/RqliteDotnet.Test/RqliteDotnet.Test.csproj +++ b/RqliteDotnet.Test/RqliteDotnet.Test.csproj @@ -1,16 +1,19 @@ - net6.0 + net8.0 false - + - - - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/RqliteDotnet/RqliteClient.cs b/RqliteDotnet/RqliteClient.cs index 8783062..f99f8d2 100644 --- a/RqliteDotnet/RqliteClient.cs +++ b/RqliteDotnet/RqliteClient.cs @@ -10,8 +10,6 @@ namespace RqliteDotnet; - - public class RqliteClient : IRqliteClient { private readonly HttpClient _httpClient; diff --git a/RqliteDotnet/RqliteDotnet.csproj b/RqliteDotnet/RqliteDotnet.csproj index 0e53a4f..291ce20 100644 --- a/RqliteDotnet/RqliteDotnet.csproj +++ b/RqliteDotnet/RqliteDotnet.csproj @@ -1,7 +1,7 @@ - net6.0 + net6.0;net8.0 enable enable @@ -10,7 +10,7 @@ RqliteDotnet 1.0.3 arthrp, otoolep et al. - net6.0 + net6.0;net8.0 Rqlite Dotnet .NET client for Rqlite - lightweight distributed database MIT