Skip to content

Commit

Permalink
v1 at setting up errors and middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccallum committed Aug 31, 2023
1 parent a6f49b3 commit 8674430
Show file tree
Hide file tree
Showing 37 changed files with 1,271 additions and 20 deletions.
178 changes: 178 additions & 0 deletions src/FairyBread.Tests/FairyBread.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,182 @@
<ProjectReference Include="..\FairyBread\FairyBread.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="MutationConventionsTests.Should_Respect_ShouldValidateArgument_Option.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.SchemaWorks.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_Works_caseData=4.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_Works_caseData=3.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_Works_caseData=2.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_Works_caseData=1.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_List_Works_caseData=6.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_List_Works_caseData=5.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_List_Works_caseData=4.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_List_Works_caseData=3.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_List_Works_caseData=2.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_List_Works_caseData=1.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_Array_Works_caseData=6.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_Array_Works_caseData=5.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_Array_Works_caseData=4.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_Array_Works_caseData=3.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_Array_Works_caseData=2.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Query_Array_Works_caseData=1.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Mutation_Works_caseData=4.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Mutation_Works_caseData=3.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Mutation_Works_caseData=2.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Mutation_Works_caseData=1.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Multi_TopLevelFields_And_MultiRuns_Works.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Ignores_Null_Argument_Value.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="MutationConventionsTests.Doesnt_Call_Field_Resolver_If_Invalid.verified.txt">
<DependentUpon>MutationConventionsTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Doesnt_Call_Field_Resolver_If_Invalid.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Ignores_Null_Argument_Value.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Multi_TopLevelFields_And_MultiRuns_Works.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Mutation_Works_caseData=1.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Mutation_Works_caseData=2.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Mutation_Works_caseData=3.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Mutation_Works_caseData=4.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_Array_Works_caseData=1.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_Array_Works_caseData=2.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_Array_Works_caseData=3.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_Array_Works_caseData=4.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_Array_Works_caseData=5.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_Array_Works_caseData=6.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_List_Works_caseData=1.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_List_Works_caseData=2.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_List_Works_caseData=3.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_List_Works_caseData=4.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_List_Works_caseData=5.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_List_Works_caseData=6.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_Works_caseData=1.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_Works_caseData=2.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_Works_caseData=3.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Query_Works_caseData=4.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.SchemaWorks.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
<None Update="GeneralTests.Should_Respect_ShouldValidateArgument_Option.verified.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>GeneralTests.cs</DependentUpon>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
Errors: [
{
Message: 'Some Integer' must be equal to '1'.,
Code: FairyBread_ValidationError,
Path: {
Name: someResolver,
Parent: {
IsRoot: true
},
Length: 1,
IsRoot: false
},
Extensions: {
argumentName: foo,
attemptedValue: -1,
code: FairyBread_ValidationError,
errorCode: EqualValidator,
errorMessage: 'Some Integer' must be equal to '1'.,
formattedMessagePlaceholderValues: {
ComparisonProperty: ,
ComparisonValue: 1,
PropertyName: Some Integer,
PropertyValue: -1
},
propertyName: SomeInteger,
severity: Error,
validatorName: FooInputDtoValidator
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
Data: {
read: SomeInteger: 1, SomeString: hello;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
result1: {
Errors: [
{
Message: 'Some Integer' must be equal to '1'.,
Code: FairyBread_ValidationError,
Path: {
Name: read,
Parent: {
IsRoot: true
},
Length: 1,
IsRoot: false
},
Extensions: {
argumentName: foo,
attemptedValue: -1,
code: FairyBread_ValidationError,
errorCode: EqualValidator,
errorMessage: 'Some Integer' must be equal to '1'.,
formattedMessagePlaceholderValues: {
ComparisonProperty: ,
ComparisonValue: 1,
PropertyName: Some Integer,
PropertyValue: -1
},
propertyName: SomeInteger,
severity: Error,
validatorName: FooInputDtoValidator
}
}
]
},
result2: {
Errors: [
{
Message: 'Some Integer' must be equal to '1'.,
Code: FairyBread_ValidationError,
Path: {
Name: read,
Parent: {
IsRoot: true
},
Length: 1,
IsRoot: false
},
Extensions: {
argumentName: foo,
attemptedValue: -1,
code: FairyBread_ValidationError,
errorCode: EqualValidator,
errorMessage: 'Some Integer' must be equal to '1'.,
formattedMessagePlaceholderValues: {
ComparisonProperty: ,
ComparisonValue: 1,
PropertyName: Some Integer,
PropertyValue: -1
},
propertyName: SomeInteger,
severity: Error,
validatorName: FooInputDtoValidator
}
}
]
},
result3: {
Errors: [
{
Message: 'Some Integer' must be equal to '1'.,
Code: FairyBread_ValidationError,
Path: {
Name: read,
Parent: {
IsRoot: true
},
Length: 1,
IsRoot: false
},
Extensions: {
argumentName: foo,
attemptedValue: -1,
code: FairyBread_ValidationError,
errorCode: EqualValidator,
errorMessage: 'Some Integer' must be equal to '1'.,
formattedMessagePlaceholderValues: {
ComparisonProperty: ,
ComparisonValue: 1,
PropertyName: Some Integer,
PropertyValue: -1
},
propertyName: SomeInteger,
severity: Error,
validatorName: FooInputDtoValidator
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
Data: {
write: SomeInteger: 1, SomeString: hello; EmailAddress: [email protected]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
Errors: [
{
Message: 'Some Integer' must be equal to '1'.,
Code: FairyBread_ValidationError,
Path: {
Name: write,
Parent: {
IsRoot: true
},
Length: 1,
IsRoot: false
},
Extensions: {
argumentName: foo,
attemptedValue: -1,
code: FairyBread_ValidationError,
errorCode: EqualValidator,
errorMessage: 'Some Integer' must be equal to '1'.,
formattedMessagePlaceholderValues: {
ComparisonProperty: ,
ComparisonValue: 1,
PropertyName: Some Integer,
PropertyValue: -1
},
propertyName: SomeInteger,
severity: Error,
validatorName: FooInputDtoValidator
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
Errors: [
{
Message: The specified condition was not met for 'Email Address'.,
Code: FairyBread_ValidationError,
Path: {
Name: write,
Parent: {
IsRoot: true
},
Length: 1,
IsRoot: false
},
Extensions: {
argumentName: bar,
attemptedValue: -1,
code: FairyBread_ValidationError,
errorCode: AsyncPredicateValidator,
errorMessage: The specified condition was not met for 'Email Address'.,
formattedMessagePlaceholderValues: {
PropertyName: Email Address,
PropertyValue: -1
},
propertyName: EmailAddress,
severity: Error,
validatorName: BarInputDtoAsyncValidator
}
}
]
}
Loading

0 comments on commit 8674430

Please sign in to comment.