diff --git a/src/OpenBanking.Library.BankApiModels/OpenBanking.Library.BankApiModels.csproj b/src/OpenBanking.Library.BankApiModels/OpenBanking.Library.BankApiModels.csproj index f961d8c7..34cdfcf1 100644 --- a/src/OpenBanking.Library.BankApiModels/OpenBanking.Library.BankApiModels.csproj +++ b/src/OpenBanking.Library.BankApiModels/OpenBanking.Library.BankApiModels.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/OpenBanking.Library.Connector.GenericHost/OpenBanking.Library.Connector.GenericHost.csproj b/src/OpenBanking.Library.Connector.GenericHost/OpenBanking.Library.Connector.GenericHost.csproj index 6a818910..bd5bbc85 100644 --- a/src/OpenBanking.Library.Connector.GenericHost/OpenBanking.Library.Connector.GenericHost.csproj +++ b/src/OpenBanking.Library.Connector.GenericHost/OpenBanking.Library.Connector.GenericHost.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/OpenBanking.Library.Connector.Web/OpenBanking.Library.Connector.Web.csproj b/src/OpenBanking.Library.Connector.Web/OpenBanking.Library.Connector.Web.csproj index 7a87aacf..6aef9ea1 100644 --- a/src/OpenBanking.Library.Connector.Web/OpenBanking.Library.Connector.Web.csproj +++ b/src/OpenBanking.Library.Connector.Web/OpenBanking.Library.Connector.Web.csproj @@ -26,13 +26,13 @@ - + - - - + + + diff --git a/src/OpenBanking.Library.Connector/OpenBanking.Library.Connector.csproj b/src/OpenBanking.Library.Connector/OpenBanking.Library.Connector.csproj index 4c5b8a4d..0d86a0a4 100644 --- a/src/OpenBanking.Library.Connector/OpenBanking.Library.Connector.csproj +++ b/src/OpenBanking.Library.Connector/OpenBanking.Library.Connector.csproj @@ -27,10 +27,10 @@ - - + + - + diff --git a/src/OpenBanking.WebApp.Connector/OpenBanking.WebApp.Connector.csproj b/src/OpenBanking.WebApp.Connector/OpenBanking.WebApp.Connector.csproj index 186d168d..2f7cd669 100644 --- a/src/OpenBanking.WebApp.Connector/OpenBanking.WebApp.Connector.csproj +++ b/src/OpenBanking.WebApp.Connector/OpenBanking.WebApp.Connector.csproj @@ -7,7 +7,7 @@ aa921213-9461-4f9e-8fec-153624ec67ad FinnovationLabs.OpenBanking.WebApp.Connector FinnovationLabs.OpenBanking.WebApp.Connector - 6.3.0 + 6.3.1 Finnovation Labs Limited and Contributors Finnovation Labs Limited false @@ -16,8 +16,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/OpenBanking.Library.Connector.BankTests/OpenBanking.Library.Connector.BankTests.csproj b/test/OpenBanking.Library.Connector.BankTests/OpenBanking.Library.Connector.BankTests.csproj index 50096142..2f22678a 100644 --- a/test/OpenBanking.Library.Connector.BankTests/OpenBanking.Library.Connector.BankTests.csproj +++ b/test/OpenBanking.Library.Connector.BankTests/OpenBanking.Library.Connector.BankTests.csproj @@ -16,19 +16,19 @@ - + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/OpenBanking.Library.Connector.Benchmarks/OpenBanking.Library.Connector.Benchmarks.csproj b/test/OpenBanking.Library.Connector.Benchmarks/OpenBanking.Library.Connector.Benchmarks.csproj index fe40a858..63344948 100644 --- a/test/OpenBanking.Library.Connector.Benchmarks/OpenBanking.Library.Connector.Benchmarks.csproj +++ b/test/OpenBanking.Library.Connector.Benchmarks/OpenBanking.Library.Connector.Benchmarks.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/OpenBanking.Library.Connector.IntegrationTests/OpenBanking.Library.Connector.IntegrationTests.csproj b/test/OpenBanking.Library.Connector.IntegrationTests/OpenBanking.Library.Connector.IntegrationTests.csproj index 5145a7a1..6ace5d3b 100644 --- a/test/OpenBanking.Library.Connector.IntegrationTests/OpenBanking.Library.Connector.IntegrationTests.csproj +++ b/test/OpenBanking.Library.Connector.IntegrationTests/OpenBanking.Library.Connector.IntegrationTests.csproj @@ -14,16 +14,16 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/OpenBanking.Library.Connector.IntegrationTests/Security/FileCertificateReaderTests.cs b/test/OpenBanking.Library.Connector.IntegrationTests/Security/FileCertificateReaderTests.cs index 70e20e82..1c6a65bf 100644 --- a/test/OpenBanking.Library.Connector.IntegrationTests/Security/FileCertificateReaderTests.cs +++ b/test/OpenBanking.Library.Connector.IntegrationTests/Security/FileCertificateReaderTests.cs @@ -26,13 +26,13 @@ public class FileCertificateReaderTests // } [Fact] - public void GetCertificateAsync_FileNotFound_CertificateNotReturned() + public async Task GetCertificateAsync_FileNotFound_CertificateNotReturned() { string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!; string fileName = Guid.NewGuid() + ".pfx"; - X509Certificate2? certificate = new FileCertificateReader(path).GetCertificateAsync(fileName).Result; + X509Certificate2? certificate = await new FileCertificateReader(path).GetCertificateAsync(fileName); certificate.Should().BeNull(); } diff --git a/test/OpenBanking.Library.Connector.UnitTests/Http/ApiClientTests.cs b/test/OpenBanking.Library.Connector.UnitTests/Http/ApiClientTests.cs index bce62c6c..eb8c8ce8 100644 --- a/test/OpenBanking.Library.Connector.UnitTests/Http/ApiClientTests.cs +++ b/test/OpenBanking.Library.Connector.UnitTests/Http/ApiClientTests.cs @@ -121,7 +121,7 @@ public async Task ApiClient_RequestJsonAsync_Success(string url) [Theory] [InlineData("https://a5b2a8a9-1220-4aa4-aa83-0036a7bd1e69.com/stuff")] - public void ApiClient_RequestJsonAsync_Failure_NoContent(string url) + public async Task ApiClient_RequestJsonAsync_Failure_NoContent(string url) { HttpRequestMessage req = new HttpRequestBuilder() .SetMethod(HttpMethod.Get) @@ -134,27 +134,22 @@ public void ApiClient_RequestJsonAsync_Failure_NoContent(string url) var mockHttp = new MockHttpMessageHandler(); mockHttp.When(HttpMethod.Get, url).Respond(r => new HttpResponseMessage(HttpStatusCode.OK)); - using (var http = mockHttp.ToHttpClient()) - { - var api = new ApiClient( - Substitute.For(), - http); + using var http = mockHttp.ToHttpClient(); + var api = new ApiClient( + Substitute.For(), + http); - Action a = () => - { - SerialisedEntity _ = api.SendExpectingJsonResponseAsync( - req, - null) - .Result; - }; + Func a = async () => + await api.SendExpectingJsonResponseAsync( + req, + null); - a.Should().Throw(); - } + await a.Should().ThrowAsync(); } [Theory] [InlineData("https://a5b2a8a9-1220-4aa4-aa83-0036a7bd1e69.com/stuff")] - public void ApiClient_RequestJsonAsync_Failure(string url) + public async Task ApiClient_RequestJsonAsync_Failure(string url) { HttpRequestMessage req = new HttpRequestBuilder() .SetMethod(HttpMethod.Get) @@ -174,27 +169,23 @@ public void ApiClient_RequestJsonAsync_Failure(string url) "application/json") }); - using (var http = mockHttp.ToHttpClient()) - { - var api = new ApiClient( - Substitute.For(), - http); + using var http = mockHttp.ToHttpClient(); + var api = new ApiClient( + Substitute.For(), + http); - Action a = () => - { - SerialisedEntity _ = api.SendExpectingJsonResponseAsync( - req, - null).Result; - }; + Func a = async () => + await api.SendExpectingJsonResponseAsync( + req, + null); - a.Should().Throw(); - } + await a.Should().ThrowAsync(); } [Theory] [InlineData("https://a5b2a8a9-1220-4aa4-aa83-0036a7bd1e69.com/stuff")] - public void ApiClient_RequestJsonAsync_Failure_StartEndTraceLogged(string url) + public async Task ApiClient_RequestJsonAsync_Failure_StartEndTraceLogged(string url) { HttpRequestMessage req = new HttpRequestBuilder() .SetMethod(HttpMethod.Get) @@ -215,20 +206,16 @@ public void ApiClient_RequestJsonAsync_Failure_StartEndTraceLogged(string url) "application/json") }); - using (var http = mockHttp.ToHttpClient()) - { - var api = new ApiClient(instrumentationClient, http); + using var http = mockHttp.ToHttpClient(); + var api = new ApiClient(instrumentationClient, http); - Action a = () => - { - SerialisedEntity _ = api.SendExpectingJsonResponseAsync( - req, - null).Result; - }; + Func a = async () => + await api.SendExpectingJsonResponseAsync( + req, + null); - a.Should().Throw(); - instrumentationClient.Received(1).Trace(Arg.Any()); - } + await a.Should().ThrowAsync(); + instrumentationClient.Received(1).Trace(Arg.Any()); } public class SerialisedEntity diff --git a/test/OpenBanking.Library.Connector.UnitTests/OpenBanking.Library.Connector.UnitTests.csproj b/test/OpenBanking.Library.Connector.UnitTests/OpenBanking.Library.Connector.UnitTests.csproj index 9a1a4986..07d44793 100644 --- a/test/OpenBanking.Library.Connector.UnitTests/OpenBanking.Library.Connector.UnitTests.csproj +++ b/test/OpenBanking.Library.Connector.UnitTests/OpenBanking.Library.Connector.UnitTests.csproj @@ -14,16 +14,16 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/OpenBanking.Library.Connector.UnitTests/Security/FileCertificateReaderTests.cs b/test/OpenBanking.Library.Connector.UnitTests/Security/FileCertificateReaderTests.cs index f57e7494..19c4af44 100644 --- a/test/OpenBanking.Library.Connector.UnitTests/Security/FileCertificateReaderTests.cs +++ b/test/OpenBanking.Library.Connector.UnitTests/Security/FileCertificateReaderTests.cs @@ -30,14 +30,14 @@ public void Ctor_NonNullFacade_NoExceptionThrown() [Fact] - public void GetCertificateAsync_EmptyThumbprint_NullReturned() + public async Task GetCertificateAsync_EmptyThumbprint_NullReturned() { var thumbprint = ""; var ioFacade = Substitute.For(); var rdr = new FileCertificateReader(ioFacade); - X509Certificate2? result = rdr.GetCertificateAsync(thumbprint).Result; + X509Certificate2? result = await rdr.GetCertificateAsync(thumbprint); result.Should().BeNull(); ioFacade.DidNotReceive().GetContentPath(); @@ -45,7 +45,7 @@ public void GetCertificateAsync_EmptyThumbprint_NullReturned() } [Fact] - public void GetCertificateAsync_NoFiles_NullReturned() + public async Task GetCertificateAsync_NoFiles_NullReturned() { var files = new string[0]; var contentPath = ""; @@ -58,7 +58,7 @@ public void GetCertificateAsync_NoFiles_NullReturned() var rdr = new FileCertificateReader(ioFacade); - X509Certificate2? result = rdr.GetCertificateAsync(thumbprint).Result; + X509Certificate2? result = await rdr.GetCertificateAsync(thumbprint); result.Should().BeNull(); ioFacade.Received().GetContentPath(); @@ -67,7 +67,7 @@ public void GetCertificateAsync_NoFiles_NullReturned() [Fact] - public void GetCertificateAsync_DirectoryNamespaceQueried() + public async Task GetCertificateAsync_DirectoryNamespaceQueried() { string[] files = { "file.cert" }; var contentPath = ""; @@ -83,7 +83,7 @@ public void GetCertificateAsync_DirectoryNamespaceQueried() try { - X509Certificate2? _ = rdr.GetCertificateAsync(thumbprint).Result; + X509Certificate2? _ = await rdr.GetCertificateAsync(thumbprint); throw new InvalidOperationException("Test failed"); }