From c27ae230c064b045df5ab2dde3ded805c9bd9e8b Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Fri, 28 Jul 2023 12:15:31 +0100 Subject: [PATCH 1/3] Linter --- Tests/ViaCep.IntegrationTests/AddressTests.cs | 22 +++++++++++++++---- Tests/ViaCep.IntegrationTests/ZipCodeTests.cs | 9 +++++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Tests/ViaCep.IntegrationTests/AddressTests.cs b/Tests/ViaCep.IntegrationTests/AddressTests.cs index e690168..be9967b 100644 --- a/Tests/ViaCep.IntegrationTests/AddressTests.cs +++ b/Tests/ViaCep.IntegrationTests/AddressTests.cs @@ -15,7 +15,9 @@ public async Task Search_WithValidAddress_ReturnsExpectedResult() var validZipCodeTwo = "01002-000"; //Another valid zip code for the same city and state //Act - var results = (await Client.SearchAsync(validState, validCity, validAddress, default)).ToList(); + var results = ( + await Client.SearchAsync(validState, validCity, validAddress, default) + ).ToList(); //Assert Assert.NotNull(results); @@ -31,7 +33,12 @@ public async Task Search_WithNonexistentAddress_ReturnsEmptyResults() var nonExistentCity = "Non-existent City"; //Act - var results = await Client.SearchAsync("XX", nonExistentCity, nonExistentAddress, default); + var results = await Client.SearchAsync( + "XX", + nonExistentCity, + nonExistentAddress, + default + ); //Assert Assert.Empty(results); @@ -48,8 +55,15 @@ public async Task Search_WithCanceledToken_ThrowsTaskCanceledException() cancellationTokenSource.Cancel(); //Act and Assert - await Assert.ThrowsAsync(() => - Client.SearchAsync(validState, validCity, validAddress, cancellationTokenSource.Token)); + await Assert.ThrowsAsync( + () => + Client.SearchAsync( + validState, + validCity, + validAddress, + cancellationTokenSource.Token + ) + ); } } } diff --git a/Tests/ViaCep.IntegrationTests/ZipCodeTests.cs b/Tests/ViaCep.IntegrationTests/ZipCodeTests.cs index a0a37df..3d6d193 100644 --- a/Tests/ViaCep.IntegrationTests/ZipCodeTests.cs +++ b/Tests/ViaCep.IntegrationTests/ZipCodeTests.cs @@ -27,7 +27,9 @@ public async Task Search_WithInvalidZipCode_ThrowsHttpRequestException() var invalidZipCode = "invalid"; //Act and Assert - await Assert.ThrowsAsync(() => Client.SearchAsync(invalidZipCode, default)); + await Assert.ThrowsAsync( + () => Client.SearchAsync(invalidZipCode, default) + ); } [Fact] @@ -38,8 +40,9 @@ public async Task Search_WithCanceledToken_ThrowsTaskCanceledException() cancellationTokenSource.Cancel(); //Act and Assert - await Assert.ThrowsAsync(() => - Client.SearchAsync("01001-000", cancellationTokenSource.Token)); + await Assert.ThrowsAsync( + () => Client.SearchAsync("01001-000", cancellationTokenSource.Token) + ); } } } From e3e3b5fc08ee9b2126cff25c9f628570a1cdec54 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Fri, 28 Jul 2023 12:17:56 +0100 Subject: [PATCH 2/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 60d610c..6ba389a 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ foreach(var result in results){ ## Changelog +* 2023-07-28: Add integration tests [#71](https://github.com/guibranco/ViaCEP/issues/71) by [Riju-bak](https://github.com/Riju-bak) * 2023-03-03: Update dependencies, change branch name, update logo. [@guibranco](https://github.com/guibranco) * 2021-06-21: Update dependencies version. [@guibranco](https://github.com/guibranco) * 2020-10-23: Add support to .NET Standard 2.0 and .NET Framework v4.6.1 and above. [@guibranco](https://github.com/guibranco) From 2d985cd87191c68ed59ebf112477e302bd1aed09 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Fri, 28 Jul 2023 12:18:19 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ba389a..f193f57 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ foreach(var result in results){ ## Changelog -* 2023-07-28: Add integration tests [#71](https://github.com/guibranco/ViaCEP/issues/71) by [Riju-bak](https://github.com/Riju-bak) +* 2023-07-28: Add integration tests [#71](https://github.com/guibranco/ViaCEP/issues/71) by [@Riju-bak](https://github.com/Riju-bak) * 2023-03-03: Update dependencies, change branch name, update logo. [@guibranco](https://github.com/guibranco) * 2021-06-21: Update dependencies version. [@guibranco](https://github.com/guibranco) * 2020-10-23: Add support to .NET Standard 2.0 and .NET Framework v4.6.1 and above. [@guibranco](https://github.com/guibranco)