diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28e0ebd..8e3998a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,9 +23,11 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v3 with: - dotnet-version: | + dotnet-version: | 6.0.x 7.0.x + 8.0.x + 9.0.x - name: Run tests run: dotnet test src/ --collect:"XPlat Code Coverage" diff --git a/README.md b/README.md index 12835b4..7dc6b99 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,8 @@ We strive to match Hot Chocolate's supported .NET target frameworks, though this | HotChocolate | FluentValidation | FairyBread | FairyBread docs | | ------------ | ---------------- | ---------- | --------------- | -| v13.0.0 | v10 | v10 | right here | +| v14.0.0 | v10 | v11 | right here | +| v13.0.0 | v10 | v10 | [/v10/main](https://github.com/benmccallum/fairybread/tree/v10/main) branch | | v12.4.0* | v10 | v9 | [/v9/main](https://github.com/benmccallum/fairybread/tree/v9/main) branch | | v12.0.1 | v10 | v8 | [/v8/main](https://github.com/benmccallum/fairybread/tree/v8/main) branch | | v11.0.9 | v10 | v7 | [/v7/main](https://github.com/benmccallum/fairybread/tree/v7/main) branch | diff --git a/src/Directory.Build.props b/src/Directory.Build.props index cd5e1f1..614fe14 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -18,10 +18,10 @@ https://github.com/benmccallum/fairybread/raw/master/logo-400x400.png https://github.com/benmccallum/fairybread/blob/master/LICENSE - 10.0.0 + 11.0.0-rc.1 10.0.0 - 13.0.0 + 14.0.0 net7.0; net6.0; netstandard2.0 net7.0; net6.0 diff --git a/src/FairyBread.Tests/CustomizationTests.CustomValidatorProvider_Works.verified.txt b/src/FairyBread.Tests/CustomizationTests.CustomValidatorProvider_Works.verified.txt index b1a1775..ac0b71a 100644 --- a/src/FairyBread.Tests/CustomizationTests.CustomValidatorProvider_Works.verified.txt +++ b/src/FairyBread.Tests/CustomizationTests.CustomValidatorProvider_Works.verified.txt @@ -6,11 +6,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foo, attemptedValue: 1, @@ -28,5 +34,6 @@ validatorName: CustomValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/CustomizationTests.cs b/src/FairyBread.Tests/CustomizationTests.cs index 465f9fb..9c36b83 100644 --- a/src/FairyBread.Tests/CustomizationTests.cs +++ b/src/FairyBread.Tests/CustomizationTests.cs @@ -1,6 +1,5 @@ namespace FairyBread.Tests; -[UsesVerify] public class CustomizationTests { private const string Query = @"query { read(foo: { someInteger: 1, someString: ""hello"" }) }"; @@ -30,7 +29,7 @@ public async Task CustomValidationResultHandler_Works() }); // Act - var result = await executor.ExecuteAsync(Query) as IQueryResult; + var result = await executor.ExecuteAsync(Query) as IOperationResult; // Assert Assert.NotNull(result); diff --git a/src/FairyBread.Tests/FairyBread.Tests.csproj b/src/FairyBread.Tests/FairyBread.Tests.csproj index fabd8c7..348bfdf 100644 --- a/src/FairyBread.Tests/FairyBread.Tests.csproj +++ b/src/FairyBread.Tests/FairyBread.Tests.csproj @@ -10,13 +10,13 @@ - - + + - - - - + + + + diff --git a/src/FairyBread.Tests/GeneralTests.Doesnt_Call_Field_Resolver_If_Invalid.verified.txt b/src/FairyBread.Tests/GeneralTests.Doesnt_Call_Field_Resolver_If_Invalid.verified.txt index 8536349..eac5ead 100644 --- a/src/FairyBread.Tests/GeneralTests.Doesnt_Call_Field_Resolver_If_Invalid.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Doesnt_Call_Field_Resolver_If_Invalid.verified.txt @@ -6,11 +6,17 @@ Path: { Name: someResolver, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foo, attemptedValue: -1, @@ -28,5 +34,6 @@ validatorName: FooInputDtoValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Ignores_Null_Argument_Value.verified.txt b/src/FairyBread.Tests/GeneralTests.Ignores_Null_Argument_Value.verified.txt index 764366a..9ab76f9 100644 --- a/src/FairyBread.Tests/GeneralTests.Ignores_Null_Argument_Value.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Ignores_Null_Argument_Value.verified.txt @@ -1,5 +1,6 @@ { Data: { read: SomeInteger: 1, SomeString: hello; - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Multi_TopLevelFields_And_MultiRuns_Works.verified.txt b/src/FairyBread.Tests/GeneralTests.Multi_TopLevelFields_And_MultiRuns_Works.verified.txt index 3c40ec8..c17cd4b 100644 --- a/src/FairyBread.Tests/GeneralTests.Multi_TopLevelFields_And_MultiRuns_Works.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Multi_TopLevelFields_And_MultiRuns_Works.verified.txt @@ -7,11 +7,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: foo, attemptedValue: -1, @@ -29,7 +35,8 @@ validatorName: FooInputDtoValidator } } - ] + ], + IsDataSet: true }, result2: { Errors: [ @@ -39,11 +46,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: foo, attemptedValue: -1, @@ -61,7 +74,8 @@ validatorName: FooInputDtoValidator } } - ] + ], + IsDataSet: true }, result3: { Errors: [ @@ -71,11 +85,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: foo, attemptedValue: -1, @@ -93,6 +113,7 @@ validatorName: FooInputDtoValidator } } - ] + ], + IsDataSet: true } } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=1.verified.txt b/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=1.verified.txt index f24d515..f171f43 100644 --- a/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=1.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=1.verified.txt @@ -1,5 +1,6 @@ { Data: { write: SomeInteger: 1, SomeString: hello; EmailAddress: ben@lol.com - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=2.verified.txt b/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=2.verified.txt index ff41c0c..2b48342 100644 --- a/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=2.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=2.verified.txt @@ -6,11 +6,17 @@ Path: { Name: write, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 12 + } + ], Extensions: { argumentName: foo, attemptedValue: -1, @@ -28,5 +34,6 @@ validatorName: FooInputDtoValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=3.verified.txt b/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=3.verified.txt index d2dcbfe..b00fee4 100644 --- a/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=3.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=3.verified.txt @@ -6,11 +6,17 @@ Path: { Name: write, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 12 + } + ], Extensions: { argumentName: bar, attemptedValue: -1, @@ -26,5 +32,6 @@ validatorName: BarInputDtoAsyncValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=4.verified.txt b/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=4.verified.txt index a7e0eaa..6765ead 100644 --- a/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=4.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Mutation_Works_caseData=4.verified.txt @@ -6,11 +6,17 @@ Path: { Name: write, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 12 + } + ], Extensions: { argumentName: foo, attemptedValue: -1, @@ -34,11 +40,17 @@ Path: { Name: write, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 12 + } + ], Extensions: { argumentName: foo, attemptedValue: -1, @@ -62,11 +74,17 @@ Path: { Name: write, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 12 + } + ], Extensions: { argumentName: bar, attemptedValue: -1, @@ -82,5 +100,6 @@ validatorName: BarInputDtoAsyncValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=1.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=1.verified.txt index 524ebb1..393d07a 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=1.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=1.verified.txt @@ -1,5 +1,6 @@ { Data: { readWithArrayArg: SomeInteger: 1, SomeString: hello - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=2.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=2.verified.txt index 524ebb1..393d07a 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=2.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=2.verified.txt @@ -1,5 +1,6 @@ { Data: { readWithArrayArg: SomeInteger: 1, SomeString: hello - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=3.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=3.verified.txt index 8835b7c..8466fed 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=3.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=3.verified.txt @@ -1,5 +1,6 @@ { Data: { readWithArrayArg: SomeInteger: 1, SomeString: hello, SomeInteger: 1, SomeString: hello - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=4.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=4.verified.txt index 15d0040..3fedf81 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=4.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=4.verified.txt @@ -6,11 +6,17 @@ Path: { Name: readWithArrayArg, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foos, attemptedValue: -1, @@ -29,5 +35,6 @@ validatorName: ArrayOfFooInputDtoValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=5.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=5.verified.txt index 15d0040..3fedf81 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=5.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=5.verified.txt @@ -6,11 +6,17 @@ Path: { Name: readWithArrayArg, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foos, attemptedValue: -1, @@ -29,5 +35,6 @@ validatorName: ArrayOfFooInputDtoValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=6.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=6.verified.txt index 275dd02..2bde567 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=6.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_Array_Works_caseData=6.verified.txt @@ -6,11 +6,17 @@ Path: { Name: readWithArrayArg, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foos, attemptedValue: -1, @@ -35,11 +41,17 @@ Path: { Name: readWithArrayArg, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foos, attemptedValue: -1, @@ -58,5 +70,6 @@ validatorName: ArrayOfFooInputDtoValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=1.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=1.verified.txt index e6a0e98..dc9e55a 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=1.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=1.verified.txt @@ -1,5 +1,6 @@ { Data: { readWithListArg: SomeInteger: 1, SomeString: hello - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=2.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=2.verified.txt index e6a0e98..dc9e55a 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=2.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=2.verified.txt @@ -1,5 +1,6 @@ { Data: { readWithListArg: SomeInteger: 1, SomeString: hello - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=3.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=3.verified.txt index 8442d9f..2e84894 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=3.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=3.verified.txt @@ -1,5 +1,6 @@ { Data: { readWithListArg: SomeInteger: 1, SomeString: hello, SomeInteger: 1, SomeString: hello - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=4.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=4.verified.txt index 88e7b83..c804a98 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=4.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=4.verified.txt @@ -6,11 +6,17 @@ Path: { Name: readWithListArg, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foos, attemptedValue: -1, @@ -29,5 +35,6 @@ validatorName: ListOfFooInputDtoValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=5.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=5.verified.txt index 88e7b83..c804a98 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=5.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=5.verified.txt @@ -6,11 +6,17 @@ Path: { Name: readWithListArg, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foos, attemptedValue: -1, @@ -29,5 +35,6 @@ validatorName: ListOfFooInputDtoValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=6.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=6.verified.txt index cfc5ee2..9e707fb 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=6.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_List_Works_caseData=6.verified.txt @@ -6,11 +6,17 @@ Path: { Name: readWithListArg, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foos, attemptedValue: -1, @@ -35,11 +41,17 @@ Path: { Name: readWithListArg, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foos, attemptedValue: -1, @@ -58,5 +70,6 @@ validatorName: ListOfFooInputDtoValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=1.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=1.verified.txt index 0392acb..4840712 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=1.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=1.verified.txt @@ -1,5 +1,6 @@ { Data: { read: SomeInteger: 1, SomeString: hello; EmailAddress: ben@lol.com - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=2.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=2.verified.txt index dd34832..9599e5f 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=2.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=2.verified.txt @@ -6,11 +6,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foo, attemptedValue: -1, @@ -28,5 +34,6 @@ validatorName: FooInputDtoValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=3.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=3.verified.txt index ad84a29..f814b57 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=3.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=3.verified.txt @@ -6,11 +6,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: bar, attemptedValue: -1, @@ -26,5 +32,6 @@ validatorName: BarInputDtoAsyncValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=4.verified.txt b/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=4.verified.txt index b5e10c3..2b55bbb 100644 --- a/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=4.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Query_Works_caseData=4.verified.txt @@ -6,11 +6,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foo, attemptedValue: -1, @@ -34,11 +40,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foo, attemptedValue: -1, @@ -62,11 +74,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: bar, attemptedValue: -1, @@ -82,5 +100,6 @@ validatorName: BarInputDtoAsyncValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.Should_Respect_ShouldValidateArgument_Option.verified.txt b/src/FairyBread.Tests/GeneralTests.Should_Respect_ShouldValidateArgument_Option.verified.txt index 59ea752..84d6eb7 100644 --- a/src/FairyBread.Tests/GeneralTests.Should_Respect_ShouldValidateArgument_Option.verified.txt +++ b/src/FairyBread.Tests/GeneralTests.Should_Respect_ShouldValidateArgument_Option.verified.txt @@ -1,5 +1,6 @@ { Data: { write: SomeInteger: -1, SomeString: hello; EmailAddress: ben@lol.com - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/GeneralTests.cs b/src/FairyBread.Tests/GeneralTests.cs index 42b069a..034bc79 100644 --- a/src/FairyBread.Tests/GeneralTests.cs +++ b/src/FairyBread.Tests/GeneralTests.cs @@ -1,6 +1,5 @@ namespace FairyBread.Tests; -[UsesVerify] public class GeneralTests { static GeneralTests() diff --git a/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationAttributes_valid=False.verified.txt b/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationAttributes_valid=False.verified.txt index 435be7f..452a110 100644 --- a/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationAttributes_valid=False.verified.txt +++ b/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationAttributes_valid=False.verified.txt @@ -6,11 +6,17 @@ Path: { Name: readWithExplicitValidation, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: fooInt, attemptedValue: -1, @@ -33,11 +39,17 @@ Path: { Name: readWithExplicitValidation, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: barInt, attemptedValue: -1, @@ -60,11 +72,17 @@ Path: { Name: readWithExplicitValidation, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: fooInput, attemptedValue: 0, @@ -86,11 +104,17 @@ Path: { Name: readWithExplicitValidation, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: fooInput, attemptedValue: false, @@ -112,11 +136,17 @@ Path: { Name: readWithExplicitValidation, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: fooInput, attemptedValue: 0, @@ -140,11 +170,17 @@ Path: { Name: readWithExplicitValidation, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: barInput, attemptedValue: 0, @@ -168,11 +204,17 @@ Path: { Name: readWithExplicitValidation, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: dblInput, attemptedValue: 0, @@ -194,11 +236,17 @@ Path: { Name: readWithExplicitValidation, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: dblInput, attemptedValue: false, @@ -214,5 +262,6 @@ validatorName: TestInputValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationAttributes_valid=True.verified.txt b/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationAttributes_valid=True.verified.txt index a4124b9..e094a7a 100644 --- a/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationAttributes_valid=True.verified.txt +++ b/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationAttributes_valid=True.verified.txt @@ -1,5 +1,6 @@ { Data: { readWithExplicitValidation: 1 1 1 1 | True 1 | True 1 | True - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationFluent_valid=False.verified.txt b/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationFluent_valid=False.verified.txt index 7f756a8..8f91872 100644 --- a/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationFluent_valid=False.verified.txt +++ b/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationFluent_valid=False.verified.txt @@ -6,11 +6,17 @@ Path: { Name: readWithExplicitValidationFluent, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: fooInt, attemptedValue: -1, @@ -33,11 +39,17 @@ Path: { Name: readWithExplicitValidationFluent, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: fooInt, attemptedValue: -1, @@ -60,11 +72,17 @@ Path: { Name: readWithExplicitValidationFluent, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: barInt, attemptedValue: -1, @@ -87,11 +105,17 @@ Path: { Name: readWithExplicitValidationFluent, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: fooInput, attemptedValue: 0, @@ -113,11 +137,17 @@ Path: { Name: readWithExplicitValidationFluent, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: fooInput, attemptedValue: false, @@ -139,11 +169,17 @@ Path: { Name: readWithExplicitValidationFluent, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: fooInput, attemptedValue: 0, @@ -167,11 +203,17 @@ Path: { Name: readWithExplicitValidationFluent, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: barInput, attemptedValue: 0, @@ -195,11 +237,17 @@ Path: { Name: readWithExplicitValidationFluent, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: dblInput, attemptedValue: 0, @@ -221,11 +269,17 @@ Path: { Name: readWithExplicitValidationFluent, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 3, + Column: 21 + } + ], Extensions: { argumentName: dblInput, attemptedValue: false, @@ -241,5 +295,6 @@ validatorName: TestInputValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationFluent_valid=True.verified.txt b/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationFluent_valid=True.verified.txt index cf0bf14..3af78f0 100644 --- a/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationFluent_valid=True.verified.txt +++ b/src/FairyBread.Tests/InjectorTests.Should_Respect_ExplicitValidationFluent_valid=True.verified.txt @@ -1,5 +1,6 @@ { Data: { readWithExplicitValidationFluent: 1 1 1 1 | True 1 | True 1 | True - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/InjectorTests.Works_registerValidators=False.verified.txt b/src/FairyBread.Tests/InjectorTests.Works_registerValidators=False.verified.txt index e6e8df4..2ca968f 100644 --- a/src/FairyBread.Tests/InjectorTests.Works_registerValidators=False.verified.txt +++ b/src/FairyBread.Tests/InjectorTests.Works_registerValidators=False.verified.txt @@ -5,10 +5,7 @@ nodes: [ { a: A - }, - null, - null, - null + } ] }, listArgA: 0, 0, @@ -29,5 +26,6 @@ scalarArgsB: 0 | False, scalarArgsC: hello, scalarArgsD: hello - } + }, + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/InjectorTests.Works_registerValidators=True.verified.txt b/src/FairyBread.Tests/InjectorTests.Works_registerValidators=True.verified.txt index 3c4aa6a..0dd7af7 100644 --- a/src/FairyBread.Tests/InjectorTests.Works_registerValidators=True.verified.txt +++ b/src/FairyBread.Tests/InjectorTests.Works_registerValidators=True.verified.txt @@ -6,11 +6,17 @@ Path: { Name: scalarArgsA, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 16 + } + ], Extensions: { argumentName: a, attemptedValue: 0, @@ -26,442 +32,535 @@ } }, { - Message: 'B' must not be empty., + Message: '' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: objectArgC, + Name: scalarArgsA, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 16 + } + ], Extensions: { - argumentName: input, + argumentName: b, attemptedValue: false, code: FairyBread_ValidationError, errorCode: NotEmptyValidator, - errorMessage: 'B' must not be empty., + errorMessage: '' must not be empty., formattedMessagePlaceholderValues: { - PropertyName: B, + PropertyName: null, PropertyValue: false }, - propertyName: B, severity: Error, - validatorName: TestInputValidator + validatorName: BoolValidator } }, { - Message: 'A' must not be empty., + Message: '' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: objectArgD, + Name: scalarArgsB, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 44 + } + ], Extensions: { - argumentName: input, + argumentName: a, attemptedValue: 0, code: FairyBread_ValidationError, errorCode: NotEmptyValidator, - errorMessage: 'A' must not be empty., + errorMessage: '' must not be empty., formattedMessagePlaceholderValues: { - PropertyName: A, + PropertyName: null, PropertyValue: 0 }, - propertyName: A, severity: Error, - validatorName: TestInputValidator + validatorName: IntValidator } }, { - Message: 'B' must not be empty., + Message: '' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: objectArgD, + Name: scalarArgsB, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 44 + } + ], Extensions: { - argumentName: input, + argumentName: b, attemptedValue: false, code: FairyBread_ValidationError, errorCode: NotEmptyValidator, - errorMessage: 'B' must not be empty., + errorMessage: '' must not be empty., formattedMessagePlaceholderValues: { - PropertyName: B, + PropertyName: null, PropertyValue: false }, - propertyName: B, severity: Error, - validatorName: TestInputValidator + validatorName: BoolValidator } }, { - Message: '' must be greater than '0'., + Message: '' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: arrayArgA, + Name: scalarArgsC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 72 + } + ], Extensions: { - argumentName: items, + argumentName: a, attemptedValue: 0, code: FairyBread_ValidationError, - errorCode: GreaterThanValidator, - errorMessage: '' must be greater than '0'., + errorCode: NotEmptyValidator, + errorMessage: '' must not be empty., formattedMessagePlaceholderValues: { - CollectionIndex: 0, - ComparisonProperty: , - ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, - propertyName: x[0], severity: Error, - validatorName: ArrayOfNullableIntValidator + validatorName: IntValidator } }, { - Message: '' must be greater than '0'., + Message: '' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: arrayArgA, + Name: scalarArgsC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 72 + } + ], Extensions: { - argumentName: items, - attemptedValue: 0, + argumentName: b, + attemptedValue: false, code: FairyBread_ValidationError, - errorCode: GreaterThanValidator, - errorMessage: '' must be greater than '0'., + errorCode: NotEmptyValidator, + errorMessage: '' must not be empty., formattedMessagePlaceholderValues: { - CollectionIndex: 1, - ComparisonProperty: , - ComparisonValue: 0, PropertyName: null, - PropertyValue: 0 + PropertyValue: false }, - propertyName: x[1], severity: Error, - validatorName: ArrayOfNullableIntValidator + validatorName: BoolValidator } }, { - Message: '' must be greater than '0'., + Message: '' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: listArgA, + Name: scalarArgsD, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 100 + } + ], Extensions: { - argumentName: items, + argumentName: a, attemptedValue: 0, code: FairyBread_ValidationError, - errorCode: GreaterThanValidator, - errorMessage: '' must be greater than '0'., + errorCode: NotEmptyValidator, + errorMessage: '' must not be empty., formattedMessagePlaceholderValues: { - CollectionIndex: 0, - ComparisonProperty: , - ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, - propertyName: x[0], severity: Error, - validatorName: ListOfNullableIntValidator + validatorName: IntValidator } }, { - Message: '' must be greater than '0'., + Message: '' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: listArgA, + Name: scalarArgsD, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 100 + } + ], Extensions: { - argumentName: items, - attemptedValue: 0, + argumentName: b, + attemptedValue: false, code: FairyBread_ValidationError, - errorCode: GreaterThanValidator, - errorMessage: '' must be greater than '0'., + errorCode: NotEmptyValidator, + errorMessage: '' must not be empty., formattedMessagePlaceholderValues: { - CollectionIndex: 1, - ComparisonProperty: , - ComparisonValue: 0, PropertyName: null, - PropertyValue: 0 + PropertyValue: false }, - propertyName: x[1], severity: Error, - validatorName: ListOfNullableIntValidator + validatorName: BoolValidator } }, { - Message: '' must be greater than '0'., + Message: '' must be equal to 'True'., Code: FairyBread_ValidationError, Path: { - Name: listArgB, + Name: nullableScalarArgsA, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 128 + } + ], Extensions: { - argumentName: items, - attemptedValue: 0, + argumentName: b, + attemptedValue: false, code: FairyBread_ValidationError, - errorCode: GreaterThanValidator, - errorMessage: '' must be greater than '0'., + errorCode: EqualValidator, + errorMessage: '' must be equal to 'True'., formattedMessagePlaceholderValues: { - CollectionIndex: 0, ComparisonProperty: , - ComparisonValue: 0, + ComparisonValue: true, PropertyName: null, - PropertyValue: 0 + PropertyValue: false }, - propertyName: x[0], severity: Error, - validatorName: ListOfNullableIntValidator + validatorName: NullableBoolValidator } }, { Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: listArgB, + Name: nullableScalarArgsA, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 128 + } + ], Extensions: { - argumentName: items, + argumentName: a, attemptedValue: 0, code: FairyBread_ValidationError, errorCode: GreaterThanValidator, errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { - CollectionIndex: 1, ComparisonProperty: , ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, - propertyName: x[1], severity: Error, - validatorName: ListOfNullableIntValidator + validatorName: NullableIntValidator } }, { Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: listArgC, + Name: nullableScalarArgsB, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 164 + } + ], Extensions: { - argumentName: items, + argumentName: a, attemptedValue: 0, code: FairyBread_ValidationError, errorCode: GreaterThanValidator, errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { - CollectionIndex: 0, ComparisonProperty: , ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, - propertyName: x[0], severity: Error, - validatorName: ListOfNullableIntValidator + validatorName: NullableIntValidator } }, { - Message: '' must be greater than '0'., + Message: '' must be equal to 'True'., Code: FairyBread_ValidationError, Path: { - Name: listArgC, + Name: nullableScalarArgsB, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 164 + } + ], Extensions: { - argumentName: items, - attemptedValue: 0, + argumentName: b, + attemptedValue: false, code: FairyBread_ValidationError, - errorCode: GreaterThanValidator, - errorMessage: '' must be greater than '0'., + errorCode: EqualValidator, + errorMessage: '' must be equal to 'True'., formattedMessagePlaceholderValues: { - CollectionIndex: 1, ComparisonProperty: , - ComparisonValue: 0, + ComparisonValue: true, PropertyName: null, - PropertyValue: 0 + PropertyValue: false }, - propertyName: x[1], severity: Error, - validatorName: ListOfNullableIntValidator + validatorName: NullableBoolValidator } }, { Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: listArgD, + Name: nullableScalarArgsC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 200 + } + ], Extensions: { - argumentName: items, + argumentName: a, attemptedValue: 0, code: FairyBread_ValidationError, errorCode: GreaterThanValidator, errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { - CollectionIndex: 0, ComparisonProperty: , ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, - propertyName: x[0], severity: Error, - validatorName: ListOfNullableIntValidator + validatorName: NullableIntValidator } }, { - Message: '' must be greater than '0'., + Message: '' must be equal to 'True'., Code: FairyBread_ValidationError, Path: { - Name: listArgD, + Name: nullableScalarArgsC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 200 + } + ], Extensions: { - argumentName: items, - attemptedValue: 0, + argumentName: b, + attemptedValue: false, code: FairyBread_ValidationError, - errorCode: GreaterThanValidator, - errorMessage: '' must be greater than '0'., + errorCode: EqualValidator, + errorMessage: '' must be equal to 'True'., formattedMessagePlaceholderValues: { - CollectionIndex: 1, ComparisonProperty: , - ComparisonValue: 0, + ComparisonValue: true, PropertyName: null, - PropertyValue: 0 + PropertyValue: false }, - propertyName: x[1], severity: Error, - validatorName: ListOfNullableIntValidator + validatorName: NullableBoolValidator } }, { Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: listOfListArgC, + Name: nullableScalarArgsD, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 236 + } + ], Extensions: { - argumentName: items, + argumentName: a, attemptedValue: 0, code: FairyBread_ValidationError, errorCode: GreaterThanValidator, errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { - CollectionIndex: 0, ComparisonProperty: , ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, - propertyName: x[0][0], severity: Error, - validatorName: ListOfListOfNullableIntValidator + validatorName: NullableIntValidator } }, { - Message: '' must be greater than '0'., + Message: '' must be equal to 'True'., Code: FairyBread_ValidationError, Path: { - Name: listOfListArgC, + Name: nullableScalarArgsD, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 236 + } + ], Extensions: { - argumentName: items, - attemptedValue: 0, + argumentName: b, + attemptedValue: false, code: FairyBread_ValidationError, - errorCode: GreaterThanValidator, - errorMessage: '' must be greater than '0'., + errorCode: EqualValidator, + errorMessage: '' must be equal to 'True'., formattedMessagePlaceholderValues: { - CollectionIndex: 1, ComparisonProperty: , - ComparisonValue: 0, + ComparisonValue: true, PropertyName: null, - PropertyValue: 0 + PropertyValue: false }, - propertyName: x[0][1], severity: Error, - validatorName: ListOfListOfNullableIntValidator + validatorName: NullableBoolValidator + } + }, + { + Message: 'B' must not be empty., + Code: FairyBread_ValidationError, + Path: { + Name: objectArgA, + Parent: { + IsRoot: true + }, + Length: 1, + IsRoot: false + }, + Locations: [ + { + Line: 1, + Column: 272 + } + ], + Extensions: { + argumentName: input, + attemptedValue: false, + code: FairyBread_ValidationError, + errorCode: NotEmptyValidator, + errorMessage: 'B' must not be empty., + formattedMessagePlaceholderValues: { + PropertyName: B, + PropertyValue: false + }, + propertyName: B, + severity: Error, + validatorName: TestInputValidator } }, { Message: 'A' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: objectArgC, + Name: objectArgA, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 272 + } + ], Extensions: { argumentName: input, attemptedValue: 0, @@ -483,11 +582,17 @@ Path: { Name: objectArgB, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 310 + } + ], Extensions: { argumentName: input, attemptedValue: false, @@ -509,11 +614,17 @@ Path: { Name: objectArgB, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 310 + } + ], Extensions: { argumentName: input, attemptedValue: 0, @@ -530,217 +641,255 @@ } }, { - Message: 'B' must not be empty., + Message: 'A' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: objectArgA, + Name: objectArgC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 348 + } + ], Extensions: { argumentName: input, - attemptedValue: false, + attemptedValue: 0, code: FairyBread_ValidationError, errorCode: NotEmptyValidator, - errorMessage: 'B' must not be empty., + errorMessage: 'A' must not be empty., formattedMessagePlaceholderValues: { - PropertyName: B, - PropertyValue: false + PropertyName: A, + PropertyValue: 0 }, - propertyName: B, + propertyName: A, severity: Error, validatorName: TestInputValidator } }, { - Message: '' must not be empty., + Message: 'B' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: scalarArgsA, + Name: objectArgC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 348 + } + ], Extensions: { - argumentName: b, + argumentName: input, attemptedValue: false, code: FairyBread_ValidationError, errorCode: NotEmptyValidator, - errorMessage: '' must not be empty., + errorMessage: 'B' must not be empty., formattedMessagePlaceholderValues: { - PropertyName: null, + PropertyName: B, PropertyValue: false }, + propertyName: B, severity: Error, - validatorName: BoolValidator + validatorName: TestInputValidator } }, { - Message: '' must not be empty., + Message: 'A' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: scalarArgsB, + Name: objectArgD, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 386 + } + ], Extensions: { - argumentName: a, + argumentName: input, attemptedValue: 0, code: FairyBread_ValidationError, errorCode: NotEmptyValidator, - errorMessage: '' must not be empty., + errorMessage: 'A' must not be empty., formattedMessagePlaceholderValues: { - PropertyName: null, + PropertyName: A, PropertyValue: 0 }, + propertyName: A, severity: Error, - validatorName: IntValidator + validatorName: TestInputValidator } }, { - Message: '' must not be empty., + Message: 'B' must not be empty., Code: FairyBread_ValidationError, Path: { - Name: scalarArgsB, + Name: objectArgD, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 386 + } + ], Extensions: { - argumentName: b, + argumentName: input, attemptedValue: false, code: FairyBread_ValidationError, errorCode: NotEmptyValidator, - errorMessage: '' must not be empty., + errorMessage: 'B' must not be empty., formattedMessagePlaceholderValues: { - PropertyName: null, + PropertyName: B, PropertyValue: false }, + propertyName: B, severity: Error, - validatorName: BoolValidator + validatorName: TestInputValidator } }, { - Message: '' must not be empty., + Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: scalarArgsC, + Name: arrayArgA, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 424 + } + ], Extensions: { - argumentName: a, + argumentName: items, attemptedValue: 0, code: FairyBread_ValidationError, - errorCode: NotEmptyValidator, - errorMessage: '' must not be empty., + errorCode: GreaterThanValidator, + errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { + CollectionIndex: 0, + ComparisonProperty: , + ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, + propertyName: x[0], severity: Error, - validatorName: IntValidator - } - }, - { - Message: '' must not be empty., - Code: FairyBread_ValidationError, - Path: { - Name: scalarArgsC, - Parent: { - Length: -1, - IsRoot: true - }, - IsRoot: false - }, - Extensions: { - argumentName: b, - attemptedValue: false, - code: FairyBread_ValidationError, - errorCode: NotEmptyValidator, - errorMessage: '' must not be empty., - formattedMessagePlaceholderValues: { - PropertyName: null, - PropertyValue: false - }, - severity: Error, - validatorName: BoolValidator + validatorName: ArrayOfNullableIntValidator } }, { - Message: '' must not be empty., + Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: scalarArgsD, + Name: arrayArgA, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 424 + } + ], Extensions: { - argumentName: a, + argumentName: items, attemptedValue: 0, code: FairyBread_ValidationError, - errorCode: NotEmptyValidator, - errorMessage: '' must not be empty., + errorCode: GreaterThanValidator, + errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { + CollectionIndex: 1, + ComparisonProperty: , + ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, + propertyName: x[1], severity: Error, - validatorName: IntValidator + validatorName: ArrayOfNullableIntValidator } }, { - Message: '' must not be empty., + Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: scalarArgsD, + Name: listArgA, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 449 + } + ], Extensions: { - argumentName: b, - attemptedValue: false, + argumentName: items, + attemptedValue: 0, code: FairyBread_ValidationError, - errorCode: NotEmptyValidator, - errorMessage: '' must not be empty., + errorCode: GreaterThanValidator, + errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { + CollectionIndex: 0, + ComparisonProperty: , + ComparisonValue: 0, PropertyName: null, - PropertyValue: false + PropertyValue: 0 }, + propertyName: x[0], severity: Error, - validatorName: BoolValidator + validatorName: ListOfNullableIntValidator } }, { Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: listOfListArgC, + Name: listArgA, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 449 + } + ], Extensions: { argumentName: items, attemptedValue: 0, @@ -748,257 +897,330 @@ errorCode: GreaterThanValidator, errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { - CollectionIndex: 0, + CollectionIndex: 1, ComparisonProperty: , ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, - propertyName: x[1][0], + propertyName: x[1], severity: Error, - validatorName: ListOfListOfNullableIntValidator + validatorName: ListOfNullableIntValidator } }, { Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: nullableScalarArgsA, + Name: listArgB, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 473 + } + ], Extensions: { - argumentName: a, + argumentName: items, attemptedValue: 0, code: FairyBread_ValidationError, errorCode: GreaterThanValidator, errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { + CollectionIndex: 1, ComparisonProperty: , ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, + propertyName: x[1], severity: Error, - validatorName: NullableIntValidator + validatorName: ListOfNullableIntValidator } }, { Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: nullableScalarArgsB, + Name: listArgB, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 473 + } + ], Extensions: { - argumentName: a, + argumentName: items, attemptedValue: 0, code: FairyBread_ValidationError, errorCode: GreaterThanValidator, errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { + CollectionIndex: 0, ComparisonProperty: , ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, + propertyName: x[0], severity: Error, - validatorName: NullableIntValidator + validatorName: ListOfNullableIntValidator } }, { - Message: '' must be equal to 'True'., + Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: nullableScalarArgsB, + Name: listArgC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 497 + } + ], Extensions: { - argumentName: b, - attemptedValue: false, + argumentName: items, + attemptedValue: 0, code: FairyBread_ValidationError, - errorCode: EqualValidator, - errorMessage: '' must be equal to 'True'., + errorCode: GreaterThanValidator, + errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { + CollectionIndex: 0, ComparisonProperty: , - ComparisonValue: true, + ComparisonValue: 0, PropertyName: null, - PropertyValue: false + PropertyValue: 0 }, + propertyName: x[0], severity: Error, - validatorName: NullableBoolValidator + validatorName: ListOfNullableIntValidator } }, { Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: nullableScalarArgsC, + Name: listArgC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 497 + } + ], Extensions: { - argumentName: a, + argumentName: items, attemptedValue: 0, code: FairyBread_ValidationError, errorCode: GreaterThanValidator, errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { + CollectionIndex: 1, ComparisonProperty: , ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, + propertyName: x[1], severity: Error, - validatorName: NullableIntValidator + validatorName: ListOfNullableIntValidator } }, { - Message: '' must be equal to 'True'., + Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: nullableScalarArgsC, + Name: listArgD, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 521 + } + ], Extensions: { - argumentName: b, - attemptedValue: false, + argumentName: items, + attemptedValue: 0, code: FairyBread_ValidationError, - errorCode: EqualValidator, - errorMessage: '' must be equal to 'True'., + errorCode: GreaterThanValidator, + errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { + CollectionIndex: 0, ComparisonProperty: , - ComparisonValue: true, + ComparisonValue: 0, PropertyName: null, - PropertyValue: false + PropertyValue: 0 }, + propertyName: x[0], severity: Error, - validatorName: NullableBoolValidator + validatorName: ListOfNullableIntValidator } }, { Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: nullableScalarArgsD, + Name: listArgD, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 521 + } + ], Extensions: { - argumentName: a, + argumentName: items, attemptedValue: 0, code: FairyBread_ValidationError, errorCode: GreaterThanValidator, errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { + CollectionIndex: 1, ComparisonProperty: , ComparisonValue: 0, PropertyName: null, PropertyValue: 0 }, + propertyName: x[1], severity: Error, - validatorName: NullableIntValidator + validatorName: ListOfNullableIntValidator } }, { - Message: '' must be equal to 'True'., + Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: nullableScalarArgsD, + Name: listOfListArgC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 545 + } + ], Extensions: { - argumentName: b, - attemptedValue: false, + argumentName: items, + attemptedValue: 0, code: FairyBread_ValidationError, - errorCode: EqualValidator, - errorMessage: '' must be equal to 'True'., + errorCode: GreaterThanValidator, + errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { + CollectionIndex: 0, ComparisonProperty: , - ComparisonValue: true, + ComparisonValue: 0, PropertyName: null, - PropertyValue: false + PropertyValue: 0 }, + propertyName: x[0][0], severity: Error, - validatorName: NullableBoolValidator + validatorName: ListOfListOfNullableIntValidator } }, { - Message: 'A' must not be empty., + Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: objectArgA, + Name: listOfListArgC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 545 + } + ], Extensions: { - argumentName: input, + argumentName: items, attemptedValue: 0, code: FairyBread_ValidationError, - errorCode: NotEmptyValidator, - errorMessage: 'A' must not be empty., + errorCode: GreaterThanValidator, + errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { - PropertyName: A, + CollectionIndex: 1, + ComparisonProperty: , + ComparisonValue: 0, + PropertyName: null, PropertyValue: 0 }, - propertyName: A, + propertyName: x[0][1], severity: Error, - validatorName: TestInputValidator + validatorName: ListOfListOfNullableIntValidator } }, { - Message: '' must be equal to 'True'., + Message: '' must be greater than '0'., Code: FairyBread_ValidationError, Path: { - Name: nullableScalarArgsA, + Name: listOfListArgC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 545 + } + ], Extensions: { - argumentName: b, - attemptedValue: false, + argumentName: items, + attemptedValue: 0, code: FairyBread_ValidationError, - errorCode: EqualValidator, - errorMessage: '' must be equal to 'True'., + errorCode: GreaterThanValidator, + errorMessage: '' must be greater than '0'., formattedMessagePlaceholderValues: { + CollectionIndex: 0, ComparisonProperty: , - ComparisonValue: true, + ComparisonValue: 0, PropertyName: null, - PropertyValue: false + PropertyValue: 0 }, + propertyName: x[1][0], severity: Error, - validatorName: NullableBoolValidator + validatorName: ListOfListOfNullableIntValidator } }, { @@ -1007,11 +1229,17 @@ Path: { Name: listOfListArgC, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 545 + } + ], Extensions: { argumentName: items, attemptedValue: 0, @@ -1030,5 +1258,6 @@ validatorName: ListOfListOfNullableIntValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/InjectorTests.cs b/src/FairyBread.Tests/InjectorTests.cs index 4668581..3cd426a 100644 --- a/src/FairyBread.Tests/InjectorTests.cs +++ b/src/FairyBread.Tests/InjectorTests.cs @@ -1,6 +1,5 @@ namespace FairyBread.Tests; -[UsesVerify] public class InjectorTests { private static async Task GetRequestExecutorAsync( diff --git a/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.OwnScopes_Are_Disposed.verified.txt b/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.OwnScopes_Are_Disposed.verified.txt index 3d9941d..d7863dd 100644 --- a/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.OwnScopes_Are_Disposed.verified.txt +++ b/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.OwnScopes_Are_Disposed.verified.txt @@ -6,11 +6,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foo, attemptedValue: 1, @@ -28,5 +34,6 @@ validatorName: RequiresOwnScopeValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.OwnScopes_Work.verified.txt b/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.OwnScopes_Work.verified.txt index 07b95d2..3e67364 100644 --- a/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.OwnScopes_Work.verified.txt +++ b/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.OwnScopes_Work.verified.txt @@ -6,11 +6,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foo, attemptedValue: 1, @@ -34,11 +40,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foo, attemptedValue: 1, @@ -62,11 +74,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foo, attemptedValue: 1, @@ -90,11 +108,17 @@ Path: { Name: read, Parent: { - Length: -1, IsRoot: true }, + Length: 1, IsRoot: false }, + Locations: [ + { + Line: 1, + Column: 9 + } + ], Extensions: { argumentName: foo, attemptedValue: 1, @@ -112,5 +136,6 @@ validatorName: AnotherRequiresOwnScopeValidator } } - ] + ], + IsDataSet: true } \ No newline at end of file diff --git a/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.cs b/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.cs index c45bb4c..aa07a2d 100644 --- a/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.cs +++ b/src/FairyBread.Tests/RequiresOwnScopeValidatorTests.cs @@ -1,6 +1,5 @@ namespace FairyBread.Tests; -[UsesVerify] public class RequiresOwnScopeValidatorTests { private const string Query = @"query { read(foo: { someInteger: 1, someString: ""hello"" }) }"; diff --git a/src/FairyBread/ValidationMiddlewareInjector.cs b/src/FairyBread/ValidationMiddlewareInjector.cs index e302118..23da0ce 100644 --- a/src/FairyBread/ValidationMiddlewareInjector.cs +++ b/src/FairyBread/ValidationMiddlewareInjector.cs @@ -26,7 +26,7 @@ public override void OnBeforeCompleteType( foreach (var argDef in fieldDef.Arguments) { - var argCoord = new FieldCoordinate(objTypeDef.Name, fieldDef.Name, argDef.Name); + var argCoord = new SchemaCoordinate(objTypeDef.Name, fieldDef.Name, argDef.Name); // 2. the argument should be validated according to options func if (!options.ShouldValidateArgument(objTypeDef, fieldDef, argDef))