Skip to content

Commit

Permalink
#116: add tests for addparcel handler
Browse files Browse the repository at this point in the history
  • Loading branch information
eggwhat committed Jan 19, 2024
1 parent 0844710 commit 7c30ba0
Show file tree
Hide file tree
Showing 6 changed files with 451 additions and 3 deletions.
12 changes: 12 additions & 0 deletions SwiftParcel.Services.Parcels/SwiftParcel.Services.Parcels.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SwiftParcel.Services.Parcel
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SwiftParcel.Services.Parcels.Infrastructure", "src\SwiftParcel.Services.Parcels.Infrastructure\SwiftParcel.Services.Parcels.Infrastructure\SwiftParcel.Services.Parcels.Infrastructure.csproj", "{098CDE85-D73E-4FBC-8349-742411248CA9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{46BEA55F-95AC-436A-9D3A-A7A04932FF88}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SwiftParcel.Services.Parcels.Application.UnitTests", "SwiftParcel.Services.Parcels.Application.UnitTests", "{BAAE3F52-A831-4508-AFBE-5539A461051A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SwiftParcel.Services.Parcels.Application.UnitTests", "tests\SwiftParcel.Services.Parcels.Application.UnitTests\SwiftParcel.Services.Parcels.Application.UnitTests\SwiftParcel.Services.Parcels.Application.UnitTests.csproj", "{6F67D351-065C-4E9B-A50D-DDEB58D7AB18}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -46,6 +52,10 @@ Global
{098CDE85-D73E-4FBC-8349-742411248CA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{098CDE85-D73E-4FBC-8349-742411248CA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{098CDE85-D73E-4FBC-8349-742411248CA9}.Release|Any CPU.Build.0 = Release|Any CPU
{6F67D351-065C-4E9B-A50D-DDEB58D7AB18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F67D351-065C-4E9B-A50D-DDEB58D7AB18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F67D351-065C-4E9B-A50D-DDEB58D7AB18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F67D351-065C-4E9B-A50D-DDEB58D7AB18}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{DA4A44B7-960C-4E6D-AC68-EF00868B61FB} = {676BEB4D-578A-41D1-A70C-1B59E357237E}
Expand All @@ -56,5 +66,7 @@ Global
{DF4B8924-6E29-468A-98B0-B3CC5B42FF92} = {355ED247-1070-4DE4-BB87-148538CA28AD}
{BE086060-031B-48E4-984A-95518F25E153} = {676BEB4D-578A-41D1-A70C-1B59E357237E}
{098CDE85-D73E-4FBC-8349-742411248CA9} = {BE086060-031B-48E4-984A-95518F25E153}
{BAAE3F52-A831-4508-AFBE-5539A461051A} = {46BEA55F-95AC-436A-9D3A-A7A04932FF88}
{6F67D351-065C-4E9B-A50D-DDEB58D7AB18} = {BAAE3F52-A831-4508-AFBE-5539A461051A}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
{
public class InvalidParcelDateTimeException : DomainException
{
public InvalidParcelDateTimeException(string element, string description)
: base("invalid_parcel_datetime_property", $"Parcel DateTime property ({element}) is invalid: {description}.")
public string Element { get; }
public string Value { get; }
public InvalidParcelDateTimeException(string element, string value)
: base("invalid_parcel_datetime_property", $"Parcel DateTime property ({element}) is invalid: {value}.")
{
Element = element;
Value = value;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ namespace SwiftParcel.Services.Parcels.Core.Exceptions
{
public class InvalidParcelDimensionException : DomainException
{
public string DimensionType { get; }
public double DimensionValue { get; }
public InvalidParcelDimensionException(string dimensionType, double dimensionValue)
: base("invalid_parcel_dimension", $"Parcel dimension ({dimensionType}) is invalid: {dimensionValue}."
+ $" It must be greater or equal 0.2 and less than 8.")
{

DimensionType = dimensionType;
DimensionValue = dimensionValue;
}
}
}
Loading

0 comments on commit 7c30ba0

Please sign in to comment.