Skip to content

Commit

Permalink
refactor: Change Postcode property to PascalCase
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDave1999 committed Dec 18, 2023
1 parent c89101a commit ff46faf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/FluentValidation/FailedValidationTestCases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public IEnumerator GetEnumerator()
DeliveryAddress = new Address
{
Description = string.Empty,
Postcode = string.Empty,
PostCode = string.Empty,
Country = string.Empty
},
Details = new List<OrderDetail>
Expand All @@ -55,7 +55,7 @@ public IEnumerator GetEnumerator()
"'Customer' property failed validation. Error was: 'Customer' must not be empty.",
"'Description' property failed validation. Error was: 'Description' must not be empty.",
"'DeliveryAddress.Description' property failed validation. Error was: 'Description' must not be empty.",
"'DeliveryAddress.Postcode' property failed validation. Error was: 'Postcode' must not be empty.",
"'DeliveryAddress.PostCode' property failed validation. Error was: 'Post Code' must not be empty.",
"'DeliveryAddress.Country' property failed validation. Error was: 'Country' must not be empty.",
"'Details[0].Product' property failed validation. Error was: 'Product' must not be empty.",
"'Details[0].Price' property failed validation. Error was: 'Price' must be greater than '0'.",
Expand Down
2 changes: 1 addition & 1 deletion tests/FluentValidation/ValidationResultExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void AsErrors_WhenThereAreNoErrors_ShouldReturnsEmptyCollection()
{
Customer = "Bob",
Description = "Test",
DeliveryAddress = new Address { Description = "D", Postcode = "P", Country = "C" },
DeliveryAddress = new Address { Description = "D", PostCode = "P", Country = "C" },
Details = new List<OrderDetail>
{
new()
Expand Down
4 changes: 2 additions & 2 deletions tests/FluentValidation/Validators/DeliveryAddressValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class Address
{
public string Description { get; init; }
public string Country { get; init; }
public string Postcode { get; init; }
public string PostCode { get; init; }
}

public class DeliveryAddressValidator : AbstractValidator<Address>
Expand All @@ -13,6 +13,6 @@ public DeliveryAddressValidator()
{
RuleFor(d => d.Description).NotEmpty();
RuleFor(d => d.Country).NotEmpty();
RuleFor(d => d.Postcode).NotEmpty();
RuleFor(d => d.PostCode).NotEmpty();
}
}

0 comments on commit ff46faf

Please sign in to comment.