Skip to content

Commit 3971ea2

Browse files
committed
fix: class name typos.
1 parent 20b59fd commit 3971ea2

File tree

5 files changed

+9
-168
lines changed

5 files changed

+9
-168
lines changed

CoreZipCode.Tests/Interfaces/ApiHandlerTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace CoreZipCode.Tests.Interfaces
1212
{
13-
public class ApiHandlerTests
13+
public class ApiHandlerTest
1414
{
1515
[Fact]
1616
public void Constructor_Without_Parameters_Should_Create_Instance()

CoreZipCode.Tests/Services/Postcode/PostalpincodeInApi/PostalpincodeInTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
namespace CoreZipCode.Tests.Services.Postcode.PostalpincodeInApi
1313
{
14-
public class PostalpincodeInTests
14+
public class PostalpincodeInTest
1515
{
1616
private const string ValidPincode = "110001";
1717
private const string ExpectedJsonResponse = "{\"Message\":\"Number of Post office(s) found: 21\",\"Status\":\"Success\",\"PostOffice\":[{\"Name\":\"Baroda House\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Bengali Market\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Bhagat Singh Market\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Connaught Place\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Constitution House\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Election Commission\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Janpath\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Krishi Bhawan\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Lady Harding Medical College\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"New Delhi \",\"Description\":\"\",\"BranchType\":\"Head Post Office\",\"DeliveryStatus\":\"Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"New Delhi\",\"Division\":\"New Delhi GPO\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"North Avenue\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Parliament House\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Patiala House\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Pragati Maidan\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Pragati Maidan Camp\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Rail Bhawan\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Sansad Marg\",\"Description\":\"\",\"BranchType\":\"Head Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Sansadiya Soudh\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Secretariat North\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Shastri Bhawan\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"},{\"Name\":\"Supreme Court\",\"Description\":\"\",\"BranchType\":\"Sub Post Office\",\"DeliveryStatus\":\"Non-Delivery\",\"Taluk\":\"New Delhi\",\"Circle\":\"New Delhi\",\"District\":\"Central Delhi\",\"Division\":\"New Delhi Central\",\"Region\":\"Delhi\",\"State\":\"Delhi\",\"Country\":\"India\"}]}";
1818

1919
private readonly PostalpincodeIn _service;
2020
private readonly Mock<IApiHandler> _apiHandlerMock;
2121

22-
public PostalpincodeInTests()
22+
public PostalpincodeInTest()
2323
{
2424
_apiHandlerMock = new Mock<IApiHandler>();
2525
_service = new PostalpincodeIn(_apiHandlerMock.Object);

CoreZipCode.Tests/Services/Postcode/PostcodesIoApi/PostcodesIoTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace CoreZipCode.Tests.Services.Postcode.PostcodesIoApi
1212
{
13-
public class PostcodesIoTests
13+
public class PostcodesIoTest
1414
{
1515
private const string ValidPostcode = "OX49 5NU";
1616

@@ -19,7 +19,7 @@ public class PostcodesIoTests
1919
private readonly Mock<IApiHandler> _apiHandlerMock;
2020
private readonly PostcodesIo _service;
2121

22-
public PostcodesIoTests()
22+
public PostcodesIoTest()
2323
{
2424
_apiHandlerMock = new Mock<IApiHandler>();
2525
_service = new PostcodesIo(_apiHandlerMock.Object);

CoreZipCode.Tests/Services/ZipCode/SmartyApi/SmartyTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace CoreZipCode.Tests.Services.ZipCode.SmartyApi
1414
{
15-
public class SmartyTests
15+
public class SmartyTest
1616
{
1717
private const string AuthId = "test-id";
1818
private const string AuthToken = "test-token";
@@ -22,7 +22,7 @@ public class SmartyTests
2222
private readonly Mock<IApiHandler> _handlerMock = new();
2323
private readonly Smarty _service;
2424

25-
public SmartyTests()
25+
public SmartyTest()
2626
{
2727
_service = new Smarty(_handlerMock.Object, AuthId, AuthToken);
2828
}

CoreZipCode.Tests/Services/ZipCode/ViaCepApi/ViaCepTest.cs

Lines changed: 2 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace CoreZipCode.Tests.Services.ZipCode.ViaCepApi
1212
{
13-
public class ViaCepTests
13+
public class ViaCepTest
1414
{
1515
private const string ValidCep = "14810100";
1616
private const string SingleAddressJson = "{\n \"cep\": \"14810-100\",\n \"logradouro\": \"Rua Barão do Rio Branco\",\n \"complemento\": \"\",\n \"bairro\": \"Vila Xavier (Vila Xavier)\",\n \"localidade\": \"Araraquara\",\n \"uf\": \"SP\",\n \"ibge\": \"3503208\",\n \"gia\": \"1818\",\n \"ddd\": \"16\",\n \"siafi\": \"7107\"\n}";
@@ -19,7 +19,7 @@ public class ViaCepTests
1919
private readonly Mock<IApiHandler> _handlerMock = new();
2020
private readonly ViaCep _service;
2121

22-
public ViaCepTests()
22+
public ViaCepTest()
2323
{
2424
_service = new ViaCep(_handlerMock.Object);
2525
}
@@ -323,162 +323,3 @@ public void SetZipCodeUrlBy_With_Spaces_Generates_Correct_Url()
323323
}
324324
}
325325
}
326-
327-
//using CoreZipCode.Interfaces;
328-
//using CoreZipCode.Result;
329-
//using CoreZipCode.Services.ZipCode.ViaCepApi;
330-
//using Moq;
331-
//using System.Net;
332-
//using System.Net.Http;
333-
//using System.Threading.Tasks;
334-
//using Xunit;
335-
336-
//namespace CoreZipCode.Tests.Services.ZipCode.ViaCepApi
337-
//{
338-
// public class ViaCepTests
339-
// {
340-
// private const string ValidCep = "14810100";
341-
342-
// private const string SingleAddressJson = "{\n \"cep\": \"14810-100\",\n \"logradouro\": \"Rua Barão do Rio Branco\",\n \"complemento\": \"\",\n \"bairro\": \"Vila Xavier (Vila Xavier)\",\n \"localidade\": \"Araraquara\",\n \"uf\": \"SP\",\n \"ibge\": \"3503208\",\n \"gia\": \"1818\",\n \"ddd\": \"16\",\n \"siafi\": \"7107\"\n}";
343-
// private const string ListAddressJson = "[\n {\n \"cep\": \"14810-100\",\n \"logradouro\": \"Rua Barão do Rio Branco\",\n \"complemento\": \"\",\n \"bairro\": \"Vila Xavier (Vila Xavier)\",\n \"localidade\": \"Araraquara\",\n \"uf\": \"SP\",\n \"ibge\": \"3503208\",\n \"gia\": \"1818\",\n \"ddd\": \"16\",\n \"siafi\": \"7107\" }\n]";
344-
345-
// private readonly Mock<IApiHandler> _handlerMock = new();
346-
// private readonly ViaCep _service;
347-
348-
// public ViaCepTests()
349-
// {
350-
// _service = new ViaCep(_handlerMock.Object);
351-
// }
352-
353-
// [Fact]
354-
// public void Constructor_Creates_Instance()
355-
// {
356-
// new ViaCep();
357-
// }
358-
359-
// [Fact]
360-
// public void Constructor_Creates_Instance_With_HttpClient()
361-
// {
362-
// new ViaCep(new HttpClient());
363-
// }
364-
365-
// [Fact]
366-
// public async Task GetAddressAsync_ValidCep_Returns_Success()
367-
// {
368-
// _handlerMock
369-
// .Setup(x => x.CallApiAsync($"https://viacep.com.br/ws/{ValidCep}/json/"))
370-
// .ReturnsAsync(Result<string>.Success(SingleAddressJson));
371-
372-
// var result = await _service.GetAddressAsync<ViaCepAddressModel>(ValidCep);
373-
374-
// Assert.True(result.IsSuccess);
375-
// Assert.Equal("Araraquara", result.Value.City);
376-
// Assert.Equal("SP", result.Value.State);
377-
// }
378-
379-
// [Fact]
380-
// public async Task ListAddressesAsync_ValidParams_Returns_Success_List()
381-
// {
382-
// _handlerMock
383-
// .Setup(x => x.CallApiAsync("https://viacep.com.br/ws/SP/Araraquara/barão do rio/json/"))
384-
// .ReturnsAsync(Result<string>.Success(ListAddressJson));
385-
386-
// var result = await _service.ListAddressesAsync<ViaCepAddressModel>("SP", "Araraquara", "barão do rio");
387-
388-
// Assert.True(result.IsSuccess);
389-
// Assert.Single(result.Value);
390-
// Assert.Equal("Araraquara", result.Value[0].City);
391-
// Assert.Equal("SP", result.Value[0].State);
392-
// }
393-
394-
// [Fact]
395-
// public async Task GetAddressAsync_ApiReturns404_Returns_Failure()
396-
// {
397-
// _handlerMock
398-
// .Setup(x => x.CallApiAsync(It.IsAny<string>()))
399-
// .ReturnsAsync(Result<string>.Failure(new ApiError(HttpStatusCode.NotFound, "Not found")));
400-
401-
// var result = await _service.GetAddressAsync<ViaCepAddressModel>("00000000");
402-
403-
// Assert.True(result.IsFailure);
404-
// Assert.Equal(HttpStatusCode.NotFound, result.Error.StatusCode);
405-
// }
406-
407-
// [Fact]
408-
// public async Task GetAddressAsync_InvalidCep_Throws_ViaCepException()
409-
// {
410-
// var ex = await Assert.ThrowsAsync<ViaCepException>(
411-
// () => _service.GetAddressAsync<ViaCepAddressModel>("123"));
412-
413-
// Assert.Contains("Invalid ZipCode Size", ex.Message);
414-
// }
415-
416-
// [Fact]
417-
// public async Task GetAddressAsync_NonNumericCep_Throws_ViaCepException()
418-
// {
419-
// var ex = await Assert.ThrowsAsync<ViaCepException>(
420-
// () => _service.GetAddressAsync<ViaCepAddressModel>("ABCDEF12"));
421-
422-
// Assert.Contains("Invalid ZipCode Format", ex.Message);
423-
// }
424-
425-
// [Fact]
426-
// public async Task ListAddressesAsync_InvalidState_Throws_ViaCepException()
427-
// {
428-
// var ex = await Assert.ThrowsAsync<ViaCepException>(
429-
// () => _service.ListAddressesAsync<ViaCepAddressModel>("X", "City", "Street"));
430-
431-
// Assert.Contains("Invalid State", ex.Message);
432-
// }
433-
434-
// [Fact]
435-
// public async Task ListAddressesAsync_InvalidCity_Throws_ViaCepException()
436-
// {
437-
// var ex = await Assert.ThrowsAsync<ViaCepException>(
438-
// () => _service.ListAddressesAsync<ViaCepAddressModel>("SP", "AB", "Street"));
439-
440-
// Assert.Contains("Invalid City", ex.Message);
441-
// }
442-
443-
// [Fact]
444-
// public async Task ListAddressesAsync_InvalidStreet_Throws_ViaCepException()
445-
// {
446-
// var ex = await Assert.ThrowsAsync<ViaCepException>(
447-
// () => _service.ListAddressesAsync<ViaCepAddressModel>("SP", "City", "AB"));
448-
449-
// Assert.Contains("Invalid Street", ex.Message);
450-
// }
451-
452-
// [Fact]
453-
// public async Task ListAddressesAsync_EmptyInvalidStreet_Throws_ViaCepException()
454-
// {
455-
// var ex = await Assert.ThrowsAsync<ViaCepException>(
456-
// () => _service.ListAddressesAsync<ViaCepAddressModel>("SP", "City", ""));
457-
458-
// Assert.Contains("Invalid Street, parameter below size of 3 characters.", ex.Message);
459-
// }
460-
461-
// [Fact]
462-
// public async Task ListAddressesAsync_EmptyStreet_Throws_ViaCepException()
463-
// {
464-
// var ex = await Assert.ThrowsAsync<ViaCepException>(
465-
// () => _service.ListAddressesAsync<ViaCepAddressModel>("SP", "City", "AB"));
466-
467-
// Assert.Contains("Invalid Street, parameter below size of 3 characters.", ex.Message);
468-
// }
469-
470-
// [Fact]
471-
// public void SetZipCodeUrl_Generates_Correct_Url()
472-
// {
473-
// var url = _service.SetZipCodeUrl("01001000");
474-
// Assert.Equal("https://viacep.com.br/ws/01001000/json/", url);
475-
// }
476-
477-
// [Fact]
478-
// public void SetZipCodeUrlBy_Generates_Correct_Url()
479-
// {
480-
// var url = _service.SetZipCodeUrlBy("rj", "rio de janeiro", "praia de botafogo");
481-
// Assert.Equal("https://viacep.com.br/ws/rj/rio de janeiro/praia de botafogo/json/", url);
482-
// }
483-
// }
484-
//}

0 commit comments

Comments
 (0)