From 4b4ad4d7be8c5a11f803d03199259d20e31271a7 Mon Sep 17 00:00:00 2001 From: Michael Staib <michael@chillicream.com> Date: Fri, 6 Sep 2024 18:48:09 +0200 Subject: [PATCH 1/2] Fixed QueryResult creation in QueryCacheMiddleware --- .../Extensions/CommonTestExtensions.cs | 2 +- src/Directory.Packages.props | 4 + .../DefaultHttpResponseFormatter.cs | 7 +- .../CacheControlConstraintsOptimizer.cs | 17 +- .../src/Caching/HotChocolate.Caching.csproj | 4 + .../src/Caching/QueryCacheMiddleware.cs | 30 +- .../CleanupExecutionResultExtensions.cs | 26 +- .../Abstractions/Execution/OperationResult.cs | 26 ++ .../AbstractionResources.Designer.cs | 295 ++++++------------ .../Properties/AbstractionResources.resx | 11 +- .../Execution/OperationResultBuilderTests.cs | 2 +- .../Execution/ResponseStreamTests.cs | 2 +- .../Types.NodaTime.Tests/DurationTypeTests.cs | 44 +-- ...stantTypeDateTimeOffsetIntegrationTests.cs | 10 +- .../InstantTypeGeneralIntegrationTests.cs | 18 +- .../Types.NodaTime.Tests/InstantTypeTests.cs | 18 +- .../IsoDayOfWeekTypeTests.cs | 26 +- ...teTimeTypeFullRoundtripIntegrationTests.cs | 18 +- ...lDateTimeTypeGeneralIsoIntegrationTests.cs | 18 +- .../LocalDateTimeTypeTests.cs | 18 +- ...alDateTypeFullRoundtripIntegrationTests.cs | 18 +- .../LocalDateTypeTests.cs | 18 +- ...LocalTimeTypeGeneralIsoIntegrationTests.cs | 18 +- .../LocalTimeTypeTests.cs | 22 +- ...setDateTimeTypeExtendedIntegrationTests.cs | 24 +- ...fsetDateTimeTypeGeneralIntegrationTests.cs | 24 +- ...fsetDateTimeTypeRfc3339IntegrationTests.cs | 24 +- .../OffsetDateTimeTypeTests.cs | 24 +- ...etDateTypeFullRoundtripIntegrationTests.cs | 24 +- .../OffsetDateTypeTests.cs | 24 +- .../OffsetTimeTypeExtendedIntegrationTests.cs | 24 +- .../OffsetTimeTypeRfc3339IntegrationTests.cs | 24 +- .../OffsetTimeTypeTests.cs | 24 +- ...eneralInvariantWithoutZIntegrationTests.cs | 36 +-- .../Types.NodaTime.Tests/OffsetTypeTests.cs | 28 +- ...eriodTypeNormalizingIsoIntegrationTests.cs | 18 +- .../Types.NodaTime.Tests/PeriodTypeTests.cs | 18 +- ...ZonedDateTimeTypeCustomIntegrationTests.cs | 24 +- .../ZonedDateTimeTypeTests.cs | 16 +- .../Regressions/NestedOptionalInt_2114.cs | 4 +- .../Types.Tests/Types/Scalars/AnyTypeTests.cs | 4 +- .../Types/SubscriptionTypeTests.cs | 12 +- .../SpecificationExampleTests.cs | 2 +- .../StaticQueryAnalysisTests.cs | 4 +- .../RequestExecutorBuilderExtensions.cs | 2 +- .../FilterVisitorTestBase.cs | 2 +- .../ProjectionVisitorTestBase.cs | 2 +- .../SortVisitorTestBase.cs | 2 +- .../Fusion/test/Core.Tests/DataTests.cs | 2 +- .../test/Core.Tests/DemoIntegrationTests.cs | 56 ++-- .../Fusion/test/Core.Tests/InterfaceTests.cs | 6 +- .../test/Core.Tests/IntrospectionTests.cs | 2 +- .../FilterVisitorTestBase.cs | 2 +- .../SortVisitorTestBase.cs | 2 +- .../FilterVisitorTestBase.cs | 2 +- .../MongoDbAggregateFluentTests.cs | 2 +- .../MongoDbCollectionTests.cs | 2 +- .../MongoDbFindFluentTests.cs | 2 +- ...MongoDbCursorPagingAggregateFluentTests.cs | 2 +- .../MongoDbCursorPagingFindFluentTests.cs | 2 +- .../MongoDbOffsetPagingAggregateTests.cs | 2 +- .../MongoDbOffsetPagingFindFluentTests.cs | 2 +- .../VisitorTestBase.cs | 2 +- .../ProjectionVisitorTestBase.cs | 2 +- .../MongoDbAggregateFluentTests.cs | 2 +- .../MongoDbCollectionTests.cs | 2 +- .../MongoDbFindFluentTests.cs | 2 +- .../SortVisitorTestBase.cs | 2 +- .../FilterVisitorTestBase.cs | 2 +- .../RavenAsyncDocumentQueryTests.cs | 2 +- .../RavenDocumentQueryTests.cs | 2 +- .../VisitorTestBase.cs | 2 +- .../ProjectionVisitorTestBase.cs | 2 +- .../SortVisitorTestBase.cs | 2 +- .../FilterVisitorTestBase.cs | 2 +- .../FilterVisitorTestBase.cs | 2 +- 76 files changed, 546 insertions(+), 630 deletions(-) diff --git a/src/CookieCrumble/src/CookieCrumble/Extensions/CommonTestExtensions.cs b/src/CookieCrumble/src/CookieCrumble/Extensions/CommonTestExtensions.cs index 6a65c19aab8..c3e3603cf86 100644 --- a/src/CookieCrumble/src/CookieCrumble/Extensions/CommonTestExtensions.cs +++ b/src/CookieCrumble/src/CookieCrumble/Extensions/CommonTestExtensions.cs @@ -17,7 +17,7 @@ public static ValueTask<IRequestExecutor> CreateExceptionExecutor( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("ex", queryString) .Build(); } diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index f2f22b13630..7fc6e8658ae 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -82,6 +82,7 @@ <PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" /> <PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="8.0.0" /> <PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.0" /> + <PackageVersion Include="Microsoft.Net.Http.Headers" Version="8.0.4" /> <PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" /> <PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="8.0.0" /> <PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" /> @@ -105,6 +106,7 @@ <PackageVersion Include="Microsoft.Extensions.Http" Version="7.0.0" /> <PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="7.0.0" /> <PackageVersion Include="Microsoft.Extensions.Options" Version="7.0.0" /> + <PackageVersion Include="Microsoft.Net.Http.Headers" Version="8.0.4" /> <PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" /> <PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="7.0.0" /> <PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="7.0.0" /> @@ -127,6 +129,7 @@ <PackageVersion Include="Microsoft.Extensions.Http" Version="6.0.0" /> <PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="6.0.0" /> <PackageVersion Include="Microsoft.Extensions.Options" Version="6.0.0" /> + <PackageVersion Include="Microsoft.Net.Http.Headers" Version="8.0.4" /> <PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0" /> <PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="6.0.0" /> <PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="6.0.0" /> @@ -143,6 +146,7 @@ <PackageVersion Include="Microsoft.Extensions.Http" Version="6.0.0" /> <PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="6.0.0" /> <PackageVersion Include="Microsoft.Extensions.Options" Version="6.0.0" /> + <PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.2.0" /> <PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="6.0.0" /> <PackageVersion Include="System.IO.Pipelines" Version="6.0.0" /> <PackageVersion Include="System.Net.Http.Json" Version="6.0.0" /> diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Serialization/DefaultHttpResponseFormatter.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Serialization/DefaultHttpResponseFormatter.cs index 59bec31854d..0b78420b475 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Serialization/DefaultHttpResponseFormatter.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Serialization/DefaultHttpResponseFormatter.cs @@ -8,6 +8,7 @@ using HotChocolate.Execution.Serialization; using HotChocolate.Utilities; using Microsoft.AspNetCore.Http; +using Microsoft.Net.Http.Headers; #if !NET6_0_OR_GREATER using Microsoft.Net.Http.Headers; #endif @@ -180,10 +181,10 @@ public async ValueTask FormatAsync( response.StatusCode = statusCode; if (result.ContextData is not null - && result.ContextData.TryGetValue(CacheControlHeaderValue, out var value) - && value is string cacheControlHeaderValue) + && result.ContextData.TryGetValue(WellKnownContextData.CacheControlHeaderValue, out var value) + && value is CacheControlHeaderValue cacheControlHeaderValue) { - response.Headers.CacheControl = cacheControlHeaderValue; + response.GetTypedHeaders().CacheControl = cacheControlHeaderValue; } OnWriteResponseHeaders(operationResult, format, response.Headers); diff --git a/src/HotChocolate/Caching/src/Caching/CacheControlConstraintsOptimizer.cs b/src/HotChocolate/Caching/src/Caching/CacheControlConstraintsOptimizer.cs index 2f52875a2ca..f5ec0c57eb2 100644 --- a/src/HotChocolate/Caching/src/Caching/CacheControlConstraintsOptimizer.cs +++ b/src/HotChocolate/Caching/src/Caching/CacheControlConstraintsOptimizer.cs @@ -4,6 +4,7 @@ using HotChocolate.Types; using HotChocolate.Types.Introspection; using HotChocolate.Utilities; +using Microsoft.Net.Http.Headers; using IHasDirectives = HotChocolate.Types.IHasDirectives; namespace HotChocolate.Caching; @@ -13,10 +14,6 @@ namespace HotChocolate.Caching; /// </summary> internal sealed class CacheControlConstraintsOptimizer : IOperationOptimizer { - private const string _cacheControlValueTemplate = "{0}, max-age={1}"; - private const string _cacheControlPrivateScope = "private"; - private const string _cacheControlPublicScope = "public"; - public void OptimizeOperation(OperationOptimizerContext context) { if (context.Definition.Operation is not OperationType.Query || @@ -31,18 +28,12 @@ public void OptimizeOperation(OperationOptimizerContext context) if (constraints.MaxAge is not null) { - var cacheType = constraints.Scope switch + var headerValue = new CacheControlHeaderValue { - CacheControlScope.Private => _cacheControlPrivateScope, - CacheControlScope.Public => _cacheControlPublicScope, - _ => throw ThrowHelper.UnexpectedCacheControlScopeValue(constraints.Scope), + Private = constraints.Scope == CacheControlScope.Private, + MaxAge = TimeSpan.FromSeconds(constraints.MaxAge.Value), }; - var headerValue = string.Format( - _cacheControlValueTemplate, - cacheType, - constraints.MaxAge); - context.ContextData.Add( WellKnownContextData.CacheControlConstraints, new ImmutableCacheConstraints( diff --git a/src/HotChocolate/Caching/src/Caching/HotChocolate.Caching.csproj b/src/HotChocolate/Caching/src/Caching/HotChocolate.Caching.csproj index c2e8814ca0a..f7382bc14db 100644 --- a/src/HotChocolate/Caching/src/Caching/HotChocolate.Caching.csproj +++ b/src/HotChocolate/Caching/src/Caching/HotChocolate.Caching.csproj @@ -21,6 +21,10 @@ <InternalsVisibleTo Include="HotChocolate.Caching.Http.Tests" /> </ItemGroup> + <ItemGroup> + <PackageReference Include="Microsoft.Net.Http.Headers" /> + </ItemGroup> + <ItemGroup> <Compile Update="Properties\CacheControlResources.Designer.cs"> <DesignTime>True</DesignTime> diff --git a/src/HotChocolate/Caching/src/Caching/QueryCacheMiddleware.cs b/src/HotChocolate/Caching/src/Caching/QueryCacheMiddleware.cs index 75ced5f47cd..2c82b178bf3 100644 --- a/src/HotChocolate/Caching/src/Caching/QueryCacheMiddleware.cs +++ b/src/HotChocolate/Caching/src/Caching/QueryCacheMiddleware.cs @@ -1,5 +1,6 @@ using HotChocolate.Execution; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Net.Http.Headers; using static HotChocolate.WellKnownContextData; namespace HotChocolate.Caching; @@ -28,34 +29,25 @@ public async ValueTask InvokeAsync(IRequestContext context) return; } - if (context.Operation?.ContextData is null || - !context.Operation.ContextData.TryGetValue(CacheControlHeaderValue, out var value) || - value is not string cacheControlHeaderValue) + if (context.Operation?.ContextData is null + || !context.Operation.ContextData.TryGetValue(WellKnownContextData.CacheControlHeaderValue, out var value) + || value is not CacheControlHeaderValue cacheControlHeaderValue) { return; } - var queryResult = context.Result?.ExpectQueryResult(); + // only single operation results can be cached. + var operationResult = context.Result?.ExpectSingleResult(); - if (queryResult is { Errors: null }) + if (operationResult is { Errors: null }) { var contextData = - queryResult.ContextData is not null - ? new ExtensionData(queryResult.ContextData) + operationResult.ContextData is not null + ? new ExtensionData(operationResult.ContextData) : new ExtensionData(); - contextData.Add(CacheControlHeaderValue, cacheControlHeaderValue); - - context.Result = new OperationResult( - queryResult.Data, - queryResult.Errors, - queryResult.Extensions, - contextData, - queryResult.Items, - queryResult.Incremental, - queryResult.Label, - queryResult.Path, - queryResult.HasNext); + contextData.Add(WellKnownContextData.CacheControlHeaderValue, cacheControlHeaderValue); + context.Result = operationResult.WithContextData(contextData); } } diff --git a/src/HotChocolate/Core/src/Abstractions/Execution/CleanupExecutionResultExtensions.cs b/src/HotChocolate/Core/src/Abstractions/Execution/CleanupExecutionResultExtensions.cs index bafd2d31104..30adac7043f 100644 --- a/src/HotChocolate/Core/src/Abstractions/Execution/CleanupExecutionResultExtensions.cs +++ b/src/HotChocolate/Core/src/Abstractions/Execution/CleanupExecutionResultExtensions.cs @@ -97,25 +97,39 @@ public static bool IsStreamResult(this IExecutionResult result) => result.Kind is BatchResult or DeferredResult or SubscriptionResult; /// <summary> - /// Expect a query result. + /// Expects a single GraphQL operation result. /// </summary> - public static IOperationResult ExpectQueryResult(this IExecutionResult result) + public static OperationResult ExpectSingleResult(this IExecutionResult result) { - if (result is IOperationResult qr) + if (result is OperationResult qr) { return qr; } throw new ArgumentException( - ExecutionResultExtensions_ExpectQueryResult_NotQueryResult); + ExecutionResultExtensions_ExpectOperationResult_NotOperationResult); + } + + /// <summary> + /// Expects a batch of operation results. + /// </summary> + public static OperationResultBatch ExpectOperationResultBatch(this IExecutionResult result) + { + if (result is OperationResultBatch qr) + { + return qr; + } + + throw new ArgumentException( + ExecutionResultExtensions_ExpectOperationResultBatch_NotOperationResultBatch); } /// <summary> /// Expect a stream result. /// </summary> - public static IResponseStream ExpectResponseStream(this IExecutionResult result) + public static ResponseStream ExpectResponseStream(this IExecutionResult result) { - if (result is IResponseStream rs) + if (result is ResponseStream rs) { return rs; } diff --git a/src/HotChocolate/Core/src/Abstractions/Execution/OperationResult.cs b/src/HotChocolate/Core/src/Abstractions/Execution/OperationResult.cs index 3ddb163ed3f..a984e86587c 100644 --- a/src/HotChocolate/Core/src/Abstractions/Execution/OperationResult.cs +++ b/src/HotChocolate/Core/src/Abstractions/Execution/OperationResult.cs @@ -155,6 +155,32 @@ public OperationResult WithExtensions( requestIndex: RequestIndex, variableIndex: VariableIndex); + /// <summary> + /// Creates a new <see cref="OperationResult"/> with the specified context data. + /// </summary> + /// <param name="contextData"> + /// The context data that shall be added to the result. + /// </param> + /// <returns> + /// Returns a new <see cref="OperationResult"/> that represents the result. + /// </returns> + public OperationResult WithContextData( + IReadOnlyDictionary<string, object?>? contextData) + => new OperationResult( + data: Data, + errors: Errors, + extensions: Extensions, + contextData: contextData, + items: Items, + incremental: Incremental, + label: Label, + path: Path, + hasNext: HasNext, + cleanupTasks: CleanupTasks, + isDataSet: IsDataSet, + requestIndex: RequestIndex, + variableIndex: VariableIndex); + /// <inheritdoc /> public IReadOnlyDictionary<string, object?> ToDictionary() => OperationResultHelper.ToDictionary(this); diff --git a/src/HotChocolate/Core/src/Abstractions/Properties/AbstractionResources.Designer.cs b/src/HotChocolate/Core/src/Abstractions/Properties/AbstractionResources.Designer.cs index 24ae06e4d52..051fcde5a77 100644 --- a/src/HotChocolate/Core/src/Abstractions/Properties/AbstractionResources.Designer.cs +++ b/src/HotChocolate/Core/src/Abstractions/Properties/AbstractionResources.Designer.cs @@ -11,46 +11,32 @@ namespace HotChocolate.Properties { using System; - /// <summary> - /// A strongly-typed resource class, for looking up localized strings, etc. - /// </summary> - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class AbstractionResources { - private static global::System.Resources.ResourceManager resourceMan; + private static System.Resources.ResourceManager resourceMan; - private static global::System.Globalization.CultureInfo resourceCulture; + private static System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal AbstractionResources() { } - /// <summary> - /// Returns the cached ResourceManager instance used by this class. - /// </summary> - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Resources.ResourceManager ResourceManager { get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HotChocolate.Properties.AbstractionResources", typeof(AbstractionResources).Assembly); + if (object.Equals(null, resourceMan)) { + System.Resources.ResourceManager temp = new System.Resources.ResourceManager("HotChocolate.Properties.AbstractionResources", typeof(AbstractionResources).Assembly); resourceMan = temp; } return resourceMan; } } - /// <summary> - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// </summary> - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -59,336 +45,231 @@ internal AbstractionResources() { } } - /// <summary> - /// Looks up a localized string similar to For error details look at the `Errors` property.. - /// </summary> - internal static string AggregateError_Message { + internal static string DirectiveArgument_NameMustNotBeNullOrEmpty { get { - return ResourceManager.GetString("AggregateError_Message", resourceCulture); + return ResourceManager.GetString("DirectiveArgument_NameMustNotBeNullOrEmpty", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The fieldName cannot be null or empty.. - /// </summary> - internal static string AttributeExtensions_FormatFieldName_FieldNameEmpty { + internal static string Name_MustNotBeEmpty { get { - return ResourceManager.GetString("AttributeExtensions_FormatFieldName_FieldNameEmpty", resourceCulture); + return ResourceManager.GetString("Name_MustNotBeEmpty", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The directive argument name be mustn't null or empty.. - /// </summary> - internal static string DirectiveArgument_NameMustNotBeNullOrEmpty { + internal static string OperationRequestBuilder_QueryIsNull { get { - return ResourceManager.GetString("DirectiveArgument_NameMustNotBeNullOrEmpty", resourceCulture); + return ResourceManager.GetString("OperationRequestBuilder_QueryIsNull", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The message must not be null or empty.. - /// </summary> - internal static string Error_Message_Must_Not_Be_Null { + internal static string OperationRequestBuilder_OperationIsNullOrEmpty { get { - return ResourceManager.GetString("Error_Message_Must_Not_Be_Null", resourceCulture); + return ResourceManager.GetString("OperationRequestBuilder_OperationIsNullOrEmpty", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to Key cannot be null or empty.. - /// </summary> - internal static string Error_SetExtension_Key_Cannot_Be_Empty { + internal static string State_KeyMustNotBeNullOrEmpty { get { - return ResourceManager.GetString("Error_SetExtension_Key_Cannot_Be_Empty", resourceCulture); + return ResourceManager.GetString("State_KeyMustNotBeNullOrEmpty", resourceCulture); + } + } + + internal static string Type_NameIsNotValid { + get { + return ResourceManager.GetString("Type_NameIsNotValid", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to Unknown Error. - /// </summary> internal static string Error_Unknown_Error { get { return ResourceManager.GetString("Error_Unknown_Error", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to Message cannot be null or empty.. - /// </summary> - internal static string Error_WithMessage_Message_Cannot_Be_Empty { + internal static string Error_Message_Must_Not_Be_Null { get { - return ResourceManager.GetString("Error_WithMessage_Message_Cannot_Be_Empty", resourceCulture); + return ResourceManager.GetString("Error_Message_Must_Not_Be_Null", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The specified result is expected to be a IQueryResult.. - /// </summary> - internal static string ExecutionResultExtensions_ExpectQueryResult_NotQueryResult { + internal static string Error_WithMessage_Message_Cannot_Be_Empty { get { - return ResourceManager.GetString("ExecutionResultExtensions_ExpectQueryResult_NotQueryResult", resourceCulture); + return ResourceManager.GetString("Error_WithMessage_Message_Cannot_Be_Empty", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The specified result is expected to be a IResponseStream.. - /// </summary> - internal static string ExecutionResultExtensions_ExpectResponseStream_NotResponseStream { + internal static string Path_WithPath_Path_Value_NotSupported { get { - return ResourceManager.GetString("ExecutionResultExtensions_ExpectResponseStream_NotResponseStream", resourceCulture); + return ResourceManager.GetString("Path_WithPath_Path_Value_NotSupported", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to This collection is read-only.. - /// </summary> - internal static string ExtensionDataCollection_CollectionIsReadOnly { + internal static string Error_SetExtension_Key_Cannot_Be_Empty { get { - return ResourceManager.GetString("ExtensionDataCollection_CollectionIsReadOnly", resourceCulture); + return ResourceManager.GetString("Error_SetExtension_Key_Cannot_Be_Empty", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The array has not enough space to fit all elements.. - /// </summary> - internal static string ExtensionDataKeyCollection_CopyTo_ArrayNotBigEnough { + internal static string Location_Line_Is_1_Based { get { - return ResourceManager.GetString("ExtensionDataKeyCollection_CopyTo_ArrayNotBigEnough", resourceCulture); + return ResourceManager.GetString("Location_Line_Is_1_Based", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to column is a 1-base index and cannot be less than one.. - /// </summary> internal static string Location_Column_Is_1_Based { get { return ResourceManager.GetString("Location_Column_Is_1_Based", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to line is a 1-base index and cannot be less than one.. - /// </summary> - internal static string Location_Line_Is_1_Based { + internal static string SubscriptionResult_ResultHasErrors { get { - return ResourceManager.GetString("Location_Line_Is_1_Based", resourceCulture); + return ResourceManager.GetString("SubscriptionResult_ResultHasErrors", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The feature `{0}` is missing the state with the key `{1}`.. - /// </summary> - internal static string MissingStateException_Message { + internal static string SubscriptionResult_ReadOnlyOnce { get { - return ResourceManager.GetString("MissingStateException_Message", resourceCulture); + return ResourceManager.GetString("SubscriptionResult_ReadOnlyOnce", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to There must be at least one error in the errors list.. - /// </summary> - internal static string MutationError_ErrorsEmpty { + internal static string SingleValueExtensionData_KeyNotFound { get { - return ResourceManager.GetString("MutationError_ErrorsEmpty", resourceCulture); + return ResourceManager.GetString("SingleValueExtensionData_KeyNotFound", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to Errors are not allowed to be null. - /// </summary> - internal static string MutationResult_ErrorElementIsNull { + internal static string ExtensionDataKeyCollection_CopyTo_ArrayNotBigEnough { get { - return ResourceManager.GetString("MutationResult_ErrorElementIsNull", resourceCulture); + return ResourceManager.GetString("ExtensionDataKeyCollection_CopyTo_ArrayNotBigEnough", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The errors collection must at least specify one error.. - /// </summary> - internal static string MutationResult_ErrorsIsEmpty { + internal static string ExtensionDataCollection_CollectionIsReadOnly { get { - return ResourceManager.GetString("MutationResult_ErrorsIsEmpty", resourceCulture); + return ResourceManager.GetString("ExtensionDataCollection_CollectionIsReadOnly", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The specified name mustn't be empty.. - /// </summary> - internal static string Name_MustNotBeEmpty { + internal static string SingleValueExtensionData_KeyIsEmpty { get { - return ResourceManager.GetString("Name_MustNotBeEmpty", resourceCulture); + return ResourceManager.GetString("SingleValueExtensionData_KeyIsEmpty", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The specified name is not a valid GraphQL name.. - /// </summary> - internal static string NameUtils_InvalidGraphQLName { + internal static string AggregateError_Message { get { - return ResourceManager.GetString("NameUtils_InvalidGraphQLName", resourceCulture); + return ResourceManager.GetString("AggregateError_Message", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to Invalid operation id format.. - /// </summary> - internal static string OperationDocumentId_InvalidOperationIdFormat { + internal static string ResultValue_NameIsNullOrEmpty { get { - return ResourceManager.GetString("OperationDocumentId_InvalidOperationIdFormat", resourceCulture); + return ResourceManager.GetString("ResultValue_NameIsNullOrEmpty", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to A GraphQL operation document or a document id is required to create a query request.. - /// </summary> - internal static string OperationRequest_DocumentOrIdMustBeSet { + internal static string QueryResult_DataAndResultAreNull { get { - return ResourceManager.GetString("OperationRequest_DocumentOrIdMustBeSet", resourceCulture); + return ResourceManager.GetString("QueryResult_DataAndResultAreNull", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The operation source text mustn't be null or empty.. - /// </summary> - internal static string OperationRequestBuilder_OperationIsNullOrEmpty { + internal static string ThrowHelper_TryRewriteNullability_InvalidNullabilityStructure { get { - return ResourceManager.GetString("OperationRequestBuilder_OperationIsNullOrEmpty", resourceCulture); + return ResourceManager.GetString("ThrowHelper_TryRewriteNullability_InvalidNullabilityStructure", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to You must specify a query before creating a query request.. - /// </summary> - internal static string OperationRequestBuilder_QueryIsNull { + internal static string ThrowHelper_SchemaCoordinate_ArgumentNameCannotBeSetWithoutMemberName { get { - return ResourceManager.GetString("OperationRequestBuilder_QueryIsNull", resourceCulture); + return ResourceManager.GetString("ThrowHelper_SchemaCoordinate_ArgumentNameCannotBeSetWithoutMemberName", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The result must be either an operation result or a response stream.. - /// </summary> - internal static string OperationResultBatch_ResponseStreamOrOperationResult { + internal static string ThrowHelper_SchemaCoordinate_MemberNameCannotBeSetOnADirectiveCoordinate { get { - return ResourceManager.GetString("OperationResultBatch_ResponseStreamOrOperationResult", resourceCulture); + return ResourceManager.GetString("ThrowHelper_SchemaCoordinate_MemberNameCannotBeSetOnADirectiveCoordinate", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to Only string or int is allowed as path segment.. - /// </summary> - internal static string Path_WithPath_Path_Value_NotSupported { + internal static string ResponseStream_InvalidResultKind { get { - return ResourceManager.GetString("Path_WithPath_Path_Value_NotSupported", resourceCulture); + return ResourceManager.GetString("ResponseStream_InvalidResultKind", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to data and errors cannot be null at the same time.. - /// </summary> - internal static string QueryResult_DataAndResultAreNull { + internal static string ExecutionResultExtensions_ExpectResponseStream_NotResponseStream { get { - return ResourceManager.GetString("QueryResult_DataAndResultAreNull", resourceCulture); + return ResourceManager.GetString("ExecutionResultExtensions_ExpectResponseStream_NotResponseStream", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The result kind must be a BatchResult, DeferredResult or SubscriptionResult.. - /// </summary> - internal static string ResponseStream_InvalidResultKind { + internal static string ExecutionResultExtensions_ExpectOperationResult_NotOperationResult { get { - return ResourceManager.GetString("ResponseStream_InvalidResultKind", resourceCulture); + return ResourceManager.GetString("ExecutionResultExtensions_ExpectOperationResult_NotOperationResult", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to Value cannot be null or whitespace.. - /// </summary> - internal static string ResultValue_NameIsNullOrEmpty { + internal static string ExecutionResultExtensions_ExpectOperationResultBatch_NotOperationResultBatch { get { - return ResourceManager.GetString("ResultValue_NameIsNullOrEmpty", resourceCulture); + return ResourceManager.GetString("ExecutionResultExtensions_ExpectOperationResultBatch_NotOperationResultBatch", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to Value cannot be null or empty.. - /// </summary> - internal static string SingleValueExtensionData_KeyIsEmpty { + internal static string NameUtils_InvalidGraphQLName { get { - return ResourceManager.GetString("SingleValueExtensionData_KeyIsEmpty", resourceCulture); + return ResourceManager.GetString("NameUtils_InvalidGraphQLName", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The specified key `{0}` was not found.. - /// </summary> - internal static string SingleValueExtensionData_KeyNotFound { + internal static string MutationResult_ErrorElementIsNull { get { - return ResourceManager.GetString("SingleValueExtensionData_KeyNotFound", resourceCulture); + return ResourceManager.GetString("MutationResult_ErrorElementIsNull", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The state key mustn't null or empty.. - /// </summary> - internal static string State_KeyMustNotBeNullOrEmpty { + internal static string MutationResult_ErrorsIsEmpty { get { - return ResourceManager.GetString("State_KeyMustNotBeNullOrEmpty", resourceCulture); + return ResourceManager.GetString("MutationResult_ErrorsIsEmpty", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to You can only read a response stream once.. - /// </summary> - internal static string SubscriptionResult_ReadOnlyOnce { + internal static string MissingStateException_Message { get { - return ResourceManager.GetString("SubscriptionResult_ReadOnlyOnce", resourceCulture); + return ResourceManager.GetString("MissingStateException_Message", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to This result has errors and cannot read from the response stream.. - /// </summary> - internal static string SubscriptionResult_ResultHasErrors { + internal static string AttributeExtensions_FormatFieldName_FieldNameEmpty { get { - return ResourceManager.GetString("SubscriptionResult_ResultHasErrors", resourceCulture); + return ResourceManager.GetString("AttributeExtensions_FormatFieldName_FieldNameEmpty", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to A argument name without a member name is only allowed on directive coordinates.. - /// </summary> - internal static string ThrowHelper_SchemaCoordinate_ArgumentNameCannotBeSetWithoutMemberName { + internal static string MutationError_ErrorsEmpty { get { - return ResourceManager.GetString("ThrowHelper_SchemaCoordinate_ArgumentNameCannotBeSetWithoutMemberName", resourceCulture); + return ResourceManager.GetString("MutationError_ErrorsEmpty", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to A directive cannot contain a member name.. - /// </summary> - internal static string ThrowHelper_SchemaCoordinate_MemberNameCannotBeSetOnADirectiveCoordinate { + internal static string OperationDocumentId_InvalidOperationIdFormat { get { - return ResourceManager.GetString("ThrowHelper_SchemaCoordinate_MemberNameCannotBeSetOnADirectiveCoordinate", resourceCulture); + return ResourceManager.GetString("OperationDocumentId_InvalidOperationIdFormat", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to The nullability modifier does not match the field type structure.. - /// </summary> - internal static string ThrowHelper_TryRewriteNullability_InvalidNullabilityStructure { + internal static string OperationRequest_DocumentOrIdMustBeSet { get { - return ResourceManager.GetString("ThrowHelper_TryRewriteNullability_InvalidNullabilityStructure", resourceCulture); + return ResourceManager.GetString("OperationRequest_DocumentOrIdMustBeSet", resourceCulture); } } - /// <summary> - /// Looks up a localized string similar to `{0}` is not a valid GraphQL type name.. - /// </summary> - internal static string Type_NameIsNotValid { + internal static string OperationResultBatch_ResponseStreamOrOperationResult { get { - return ResourceManager.GetString("Type_NameIsNotValid", resourceCulture); + return ResourceManager.GetString("OperationResultBatch_ResponseStreamOrOperationResult", resourceCulture); } } } diff --git a/src/HotChocolate/Core/src/Abstractions/Properties/AbstractionResources.resx b/src/HotChocolate/Core/src/Abstractions/Properties/AbstractionResources.resx index 5115adc7cc2..1dd6f242b86 100644 --- a/src/HotChocolate/Core/src/Abstractions/Properties/AbstractionResources.resx +++ b/src/HotChocolate/Core/src/Abstractions/Properties/AbstractionResources.resx @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema @@ -196,10 +196,13 @@ <value>The result kind must be a BatchResult, DeferredResult or SubscriptionResult.</value> </data> <data name="ExecutionResultExtensions_ExpectResponseStream_NotResponseStream" xml:space="preserve"> - <value>The specified result is expected to be a IResponseStream.</value> + <value>The specified result is expected to be a ResponseStream.</value> </data> - <data name="ExecutionResultExtensions_ExpectQueryResult_NotQueryResult" xml:space="preserve"> - <value>The specified result is expected to be a IQueryResult.</value> + <data name="ExecutionResultExtensions_ExpectOperationResult_NotOperationResult" xml:space="preserve"> + <value>The specified result is expected to be an OperationResult.</value> + </data> + <data name="ExecutionResultExtensions_ExpectOperationResultBatch_NotOperationResultBatch" xml:space="preserve"> + <value>The specified result is expected to be an OperationResultBatch.</value> </data> <data name="NameUtils_InvalidGraphQLName" xml:space="preserve"> <value>The specified name is not a valid GraphQL name.</value> diff --git a/src/HotChocolate/Core/test/Abstractions.Tests/Execution/OperationResultBuilderTests.cs b/src/HotChocolate/Core/test/Abstractions.Tests/Execution/OperationResultBuilderTests.cs index 278d41e4da6..34c3ea17481 100644 --- a/src/HotChocolate/Core/test/Abstractions.Tests/Execution/OperationResultBuilderTests.cs +++ b/src/HotChocolate/Core/test/Abstractions.Tests/Execution/OperationResultBuilderTests.cs @@ -50,7 +50,7 @@ public void ExpectQueryResult() .Build(); // act - var queryResult = result.ExpectQueryResult(); + var queryResult = result.ExpectSingleResult(); // assert Assert.NotNull(queryResult); diff --git a/src/HotChocolate/Core/test/Abstractions.Tests/Execution/ResponseStreamTests.cs b/src/HotChocolate/Core/test/Abstractions.Tests/Execution/ResponseStreamTests.cs index 8002aff4ac0..a6d7982c62d 100644 --- a/src/HotChocolate/Core/test/Abstractions.Tests/Execution/ResponseStreamTests.cs +++ b/src/HotChocolate/Core/test/Abstractions.Tests/Execution/ResponseStreamTests.cs @@ -155,7 +155,7 @@ public void ExpectResponseStream() IExecutionResult result = new ResponseStream(() => default!); // act - void Fail() => result.ExpectQueryResult(); + void Fail() => result.ExpectSingleResult(); // assert Assert.Throws<ArgumentException>(Fail); diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/DurationTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/DurationTypeTests.cs index 1688ce4ceaf..787ebe90440 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/DurationTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/DurationTypeTests.cs @@ -41,42 +41,42 @@ public Duration Test(Duration arg) public void QueryReturnsSerializedDataWithDecimals() { var result = _testExecutor.Execute("query { test: positiveWithDecimals }"); - Assert.Equal("123:07:53:10.019", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("123:07:53:10.019", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsSerializedDataWithNegativeValue() { var result = _testExecutor.Execute("query{test: negativeWithDecimals}"); - Assert.Equal("-123:07:53:10.019", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("-123:07:53:10.019", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsSerializedDataWithoutDecimals() { var result = _testExecutor.Execute("query{test: positiveWithoutDecimals}"); - Assert.Equal("123:07:53:10", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("123:07:53:10", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsSerializedDataWithoutSeconds() { var result = _testExecutor.Execute("query{test:positiveWithoutSeconds}"); - Assert.Equal("123:07:53:00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("123:07:53:00", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsSerializedDataWithoutMinutes() { var result = _testExecutor.Execute("query{test:positiveWithoutMinutes}"); - Assert.Equal("123:07:00:00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("123:07:00:00", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsSerializedDataWithRoundtrip() { var result = _testExecutor.Execute("query{test:positiveWithRoundtrip}"); - Assert.Equal("124:02:01:10", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("124:02:01:10", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -87,7 +87,7 @@ public void MutationParsesInputWithDecimals() .SetDocument("mutation($arg: Duration!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "09:22:01:00.019" }, }) .Build()); - Assert.Equal("9:22:11:00.019", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("9:22:11:00.019", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -98,7 +98,7 @@ public void MutationParsesInputWithoutDecimals() .SetDocument("mutation($arg: Duration!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "09:22:01:00" }, }) .Build()); - Assert.Equal("9:22:11:00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("9:22:11:00", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -109,7 +109,7 @@ public void MutationParsesInputWithoutLeadingZero() .SetDocument("mutation($arg: Duration!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "9:22:01:00" }, }) .Build()); - Assert.Equal("9:22:11:00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("9:22:11:00", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -120,7 +120,7 @@ public void MutationParsesInputWithNegativeValue() .SetDocument("mutation($arg: Duration!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "-9:22:01:00" }, }) .Build()); - Assert.Equal("-9:21:51:00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("-9:21:51:00", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -131,8 +131,8 @@ public void MutationDoesntParseInputWithPlusSign() .SetDocument("mutation($arg: Duration!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "+09:22:01:00" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -143,8 +143,8 @@ public void MutationDoesntParseInputWithOverflownHours() .SetDocument("mutation($arg: Duration!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "9:26:01:00" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -155,7 +155,7 @@ public void MutationParsesLiteralWithDecimals() .SetDocument("mutation { test(arg: \"09:22:01:00.019\") }") .Build()); - Assert.Equal("9:22:11:00.019", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("9:22:11:00.019", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -166,7 +166,7 @@ public void MutationParsesLiteralWithoutDecimals() .SetDocument("mutation { test(arg: \"09:22:01:00\") }") .Build()); - Assert.Equal("9:22:11:00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("9:22:11:00", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -177,7 +177,7 @@ public void MutationParsesLiteralWithoutLeadingZero() .SetDocument("mutation { test(arg: \"09:22:01:00\") }") .Build()); - Assert.Equal("9:22:11:00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("9:22:11:00", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -188,7 +188,7 @@ public void MutationParsesLiteralWithNegativeValue() .SetDocument("mutation { test(arg: \"-9:22:01:00\") }") .Build()); - Assert.Equal("-9:21:51:00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("-9:21:51:00", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -199,8 +199,8 @@ public void MutationDoesntParseLiteralWithPlusSign() .SetDocument("mutation { test(arg: \"+09:22:01:00\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -211,8 +211,8 @@ public void MutationDoesntParseLiteralWithOverflownHours() .SetDocument("mutation { test(arg: \"9:26:01:00\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeDateTimeOffsetIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeDateTimeOffsetIntegrationTests.cs index 340263512d4..fa71f2a1fa7 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeDateTimeOffsetIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeDateTimeOffsetIntegrationTests.cs @@ -50,7 +50,7 @@ public void QueryReturnsUtc() Assert.Equal( "2020-02-20T17:42:59.000001234Z", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -64,7 +64,7 @@ public void ParsesVariable() Assert.Equal( "2020-02-21T17:52:59.000001234Z", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -76,7 +76,7 @@ public void DoesParseAnIncorrectExtendedVariableAsDateTimeOffset() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-02-20T17:42:59" }, }) .Build()); - Assert.Equal("2020-02-20T17:52:59Z", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-20T17:52:59Z", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -89,7 +89,7 @@ public void ParsesLiteral() Assert.Equal( "2020-02-20T17:52:59.000001234Z", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -100,7 +100,7 @@ public void DoesParseIncorrectExtendedLiteralAsDateTimeOffset() .SetDocument("mutation { test(arg: \"2020-02-20T17:42:59\") }") .Build()); - Assert.Equal("2020-02-20T17:52:59Z", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-20T17:52:59Z", result.ExpectSingleResult().Data!["test"]); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeGeneralIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeGeneralIntegrationTests.cs index e55045510fe..1ed5e4131d1 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeGeneralIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeGeneralIntegrationTests.cs @@ -19,7 +19,7 @@ public void QueryReturnsUtc() { var result = _testExecutor.Execute("query { test: one }"); - Assert.Equal("2020-02-20T17:42:59Z", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-20T17:42:59Z", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -31,7 +31,7 @@ public void ParsesVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-02-21T17:42:59Z" }, }) .Build()); - Assert.Equal("2020-02-21T17:52:59Z", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-21T17:52:59Z", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -43,8 +43,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-02-20T17:42:59" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -55,7 +55,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"2020-02-20T17:42:59Z\") }") .Build()); - Assert.Equal("2020-02-20T17:52:59Z", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-20T17:52:59Z", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -66,12 +66,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-02-20T17:42:59\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors!.First().Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors!.First().Code); Assert.Equal( "Unable to deserialize string to Instant", - result.ExpectQueryResult().Errors!.First().Message); + result.ExpectSingleResult().Errors!.First().Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeTests.cs index 37473328e8d..c1b1a8d5c67 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/InstantTypeTests.cs @@ -36,7 +36,7 @@ public void QueryReturnsUtc() Assert.Equal( "2020-02-20T17:42:59.000001234Z", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -50,7 +50,7 @@ public void ParsesVariable() Assert.Equal( "2020-02-21T17:52:59.000001234Z", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -62,8 +62,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-02-20T17:42:59" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -76,7 +76,7 @@ public void ParsesLiteral() Assert.Equal( "2020-02-20T17:52:59.000001234Z", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -87,12 +87,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-02-20T17:42:59\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to Instant", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } [Fact] diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/IsoDayOfWeekTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/IsoDayOfWeekTypeTests.cs index e9886919c84..3189872caa8 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/IsoDayOfWeekTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/IsoDayOfWeekTypeTests.cs @@ -39,7 +39,7 @@ public void QueryReturnsMonday() { var result = _testExecutor.Execute("query { test: monday }"); - Assert.Equal(1, result.ExpectQueryResult().Data!["test"]); + Assert.Equal(1, result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -47,7 +47,7 @@ public void QueryReturnsSunday() { var result = _testExecutor.Execute("query { test: sunday }"); - Assert.Equal(7, result.ExpectQueryResult().Data!["test"]); + Assert.Equal(7, result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -55,7 +55,7 @@ public void QueryReturnsFriday() { var result = _testExecutor.Execute("query { test: friday }"); - Assert.Equal(5, result.ExpectQueryResult().Data!["test"]); + Assert.Equal(5, result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -63,8 +63,8 @@ public void QueryDoesntReturnNone() { var result = _testExecutor.Execute("query { test: none }"); - Assert.Null(result.ExpectQueryResult().Data); - Assert.NotEmpty(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.NotEmpty(result.ExpectSingleResult().Errors!); } [Fact] @@ -76,7 +76,7 @@ public void MutationParsesMonday() .SetVariableValues(new Dictionary<string, object?> { {"arg", 1 }, }) .Build()); - Assert.Equal(2, result.ExpectQueryResult().Data!["test"]); + Assert.Equal(2, result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -88,7 +88,7 @@ public void MutationParsesSunday() .SetVariableValues(new Dictionary<string, object?> { {"arg", 7 }, }) .Build()); - Assert.Equal(1, result.ExpectQueryResult().Data!["test"]); + Assert.Equal(1, result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -100,8 +100,8 @@ public void MutationDoesntParseZero() .SetVariableValues(new Dictionary<string, object?> { {"arg", 0 }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -113,8 +113,8 @@ public void MutationDoesntParseEight() .SetVariableValues(new Dictionary<string, object?> { {"arg", 8 }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -126,8 +126,8 @@ public void MutationDoesntParseNegativeNumbers() .SetVariableValues(new Dictionary<string, object?> { {"arg", -2 }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeFullRoundtripIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeFullRoundtripIntegrationTests.cs index 87377ee61da..d36973fa266 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeFullRoundtripIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeFullRoundtripIntegrationTests.cs @@ -21,7 +21,7 @@ public void QueryReturns() Assert.Equal( "2020-02-07T17:42:59.000001234 (Julian)", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -35,7 +35,7 @@ public void ParsesVariable() Assert.Equal( "2020-02-21T17:52:59.000001234 (Julian)", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -47,8 +47,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-02-20T17:42:59Z" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -61,7 +61,7 @@ public void ParsesLiteral() Assert.Equal( "2020-02-20T17:52:59.000001234 (Julian)", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -72,12 +72,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-02-20T17:42:59Z\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to LocalDateTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeGeneralIsoIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeGeneralIsoIntegrationTests.cs index 1f8ebc6f732..dc461fe4897 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeGeneralIsoIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeGeneralIsoIntegrationTests.cs @@ -19,7 +19,7 @@ public void QueryReturns() { var result = _testExecutor.Execute("query { test: one }"); - Assert.Equal("2020-02-07T17:42:59", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-07T17:42:59", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -31,7 +31,7 @@ public void ParsesVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-02-21T17:42:59" }, }) .Build()); - Assert.Equal("2020-02-21T17:52:59", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-21T17:52:59", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -43,8 +43,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-02-20T17:42:59Z" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -55,7 +55,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"2020-02-20T17:42:59\") }") .Build()); - Assert.Equal("2020-02-20T17:52:59", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-20T17:52:59", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -66,12 +66,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-02-20T17:42:59Z\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to LocalDateTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeTests.cs index 5ddf049a77e..4596b496a0b 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTimeTypeTests.cs @@ -38,7 +38,7 @@ public void QueryReturns() { var result = _testExecutor.Execute("query { test: one }"); - Assert.Equal("2020-02-07T17:42:59.000001234", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-07T17:42:59.000001234", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -52,7 +52,7 @@ public void ParsesVariable() new Dictionary<string, object?> { { "arg", "2020-02-21T17:42:59.000001234" }, }) .Build()); - Assert.Equal("2020-02-21T17:52:59.000001234", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-21T17:52:59.000001234", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -66,8 +66,8 @@ public void DoesntParseAnIncorrectVariable() new Dictionary<string, object?> { { "arg", "2020-02-20T17:42:59.000001234Z" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -79,7 +79,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"2020-02-20T17:42:59.000001234\") }") .Build()); - Assert.Equal("2020-02-20T17:52:59.000001234", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-20T17:52:59.000001234", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -91,12 +91,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-02-20T17:42:59.000001234Z\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to LocalDateTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } [Fact] diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTypeFullRoundtripIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTypeFullRoundtripIntegrationTests.cs index 83f547e0836..6c98f6da900 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTypeFullRoundtripIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTypeFullRoundtripIntegrationTests.cs @@ -19,7 +19,7 @@ public void QueryReturns() { var result = _testExecutor.Execute("query { test: one }"); - Assert.Equal("5780-05-25 (Hebrew Civil)", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("5780-05-25 (Hebrew Civil)", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -32,7 +32,7 @@ public void ParsesVariable() .SetVariableValues(new Dictionary<string, object?> { { "arg", "2020-02-21 (Hebrew Civil)" }, }) .Build()); - Assert.Equal("2020-02-24 (Hebrew Civil)", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-24 (Hebrew Civil)", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -46,8 +46,8 @@ public void DoesntParseAnIncorrectVariable() new Dictionary<string, object?> { { "arg", "2020-02-20T17:42:59 (Hebrew Civil)" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -59,7 +59,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"2020-02-20 (Hebrew Civil)\") }") .Build()); - Assert.Equal("2020-02-23 (Hebrew Civil)", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-23 (Hebrew Civil)", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -71,12 +71,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-02-20T17:42:59 (Hebrew Civil)\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to LocalDate", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTypeTests.cs index 60d29d1dcdf..d340e005cb8 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalDateTypeTests.cs @@ -36,7 +36,7 @@ public void QueryReturns() { var result = _testExecutor.Execute("query { test: one }"); - Assert.Equal("5780-05-25", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("5780-05-25", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -48,7 +48,7 @@ public void ParsesVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-02-21" }, }) .Build()); - Assert.Equal("2020-02-24", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-24", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -60,8 +60,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-02-20T17:42:59" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -72,7 +72,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"2020-02-20\") }") .Build()); - Assert.Equal("2020-02-23", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-02-23", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -83,12 +83,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-02-20T17:42:59\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to LocalDate", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } [Fact] diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalTimeTypeGeneralIsoIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalTimeTypeGeneralIsoIntegrationTests.cs index 9fe0cfddb8c..5287f630be4 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalTimeTypeGeneralIsoIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalTimeTypeGeneralIsoIntegrationTests.cs @@ -19,7 +19,7 @@ public void QueryReturns() { var result = _testExecutor.Execute("query { test: one }"); - Assert.Equal("12:42:13", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("12:42:13", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -31,7 +31,7 @@ public void ParsesVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "12:42:13" }, }) .Build()); - Assert.Equal("12:52:13", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("12:52:13", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -43,8 +43,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "12:42" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -55,7 +55,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"12:42:13\") }") .Build()); - Assert.Equal("12:52:13", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("12:52:13", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -66,12 +66,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"12:42\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to LocalTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalTimeTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalTimeTypeTests.cs index b6b714cb016..3ea89d6035f 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalTimeTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/LocalTimeTypeTests.cs @@ -36,7 +36,7 @@ public void QueryReturns() { var result = _testExecutor.Execute("query { test: one }"); - Assert.Equal("12:42:13.031011234", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("12:42:13.031011234", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -49,7 +49,7 @@ public void ParsesVariable() .SetVariableValues(new Dictionary<string, object?> { { "arg", "12:42:13.031011234" }, }) .Build()); - Assert.Equal("12:52:13.031011234", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("12:52:13.031011234", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -62,7 +62,7 @@ public void ParsesVariableWithoutTicks() .SetVariableValues(new Dictionary<string, object?> { { "arg", "12:42:13" }, }) .Build()); - Assert.Equal("12:52:13", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("12:52:13", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -75,8 +75,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { { "arg", "12:42" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -88,7 +88,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"12:42:13.031011234\") }") .Build()); - Assert.Equal("12:52:13.031011234", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("12:52:13.031011234", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -100,7 +100,7 @@ public void ParsesLiteralWithoutTick() .SetDocument("mutation { test(arg: \"12:42:13\") }") .Build()); - Assert.Equal("12:52:13", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("12:52:13", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -112,12 +112,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"12:42\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to LocalTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } [Fact] diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeExtendedIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeExtendedIntegrationTests.cs index 41e8d2e13d6..27c20088c14 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeExtendedIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeExtendedIntegrationTests.cs @@ -19,7 +19,7 @@ public void QueryReturns() { var result = _testExecutor.Execute("query { test: hours }"); - Assert.Equal("2020-12-31T18:30:13.000001234+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:30:13.000001234+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -27,7 +27,7 @@ public void QueryReturnsWithMinutes() { var result = _testExecutor.Execute("query { test: hoursAndMinutes }"); - Assert.Equal("2020-12-31T18:30:13.000001234+02:30", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:30:13.000001234+02:30", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -40,7 +40,7 @@ public void ParsesVariable() .SetVariableValues(new Dictionary<string, object?> { { "arg", "2020-12-31T18:30:13+02" }, }) .Build()); - Assert.Equal("2020-12-31T18:40:13+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -53,7 +53,7 @@ public void ParsesVariableWithMinutes() .SetVariableValues(new Dictionary<string, object?> { { "arg", "2020-12-31T18:30:13+02:35" }, }) .Build()); - Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -66,8 +66,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { { "arg", "2020-12-31T18:30:13" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -79,7 +79,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"2020-12-31T18:30:13+02\") }") .Build()); - Assert.Equal("2020-12-31T18:40:13+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -91,7 +91,7 @@ public void ParsesLiteralWithMinutes() .SetDocument("mutation { test(arg: \"2020-12-31T18:30:13+02:35\") }") .Build()); - Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -103,12 +103,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-12-31T18:30:13\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to OffsetDateTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeGeneralIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeGeneralIntegrationTests.cs index 8df4f7d555c..00a1fe58f61 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeGeneralIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeGeneralIntegrationTests.cs @@ -18,14 +18,14 @@ public class OffsetDateTimeTypeGeneralIntegrationTests public void QueryReturns() { var result = _testExecutor.Execute("query { test: hours }"); - Assert.Equal("2020-12-31T18:30:13+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:30:13+02", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsWithMinutes() { var result = _testExecutor.Execute("query { test: hoursAndMinutes }"); - Assert.Equal("2020-12-31T18:30:13+02:30", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:30:13+02:30", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -36,7 +36,7 @@ public void ParsesVariable() .SetDocument("mutation($arg: OffsetDateTime!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31T18:30:13+02" }, }) .Build()); - Assert.Equal("2020-12-31T18:40:13+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -47,7 +47,7 @@ public void ParsesVariableWithMinutes() .SetDocument("mutation($arg: OffsetDateTime!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31T18:30:13+02:35" }, }) .Build()); - Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -58,8 +58,8 @@ public void DoesntParseAnIncorrectVariable() .SetDocument("mutation($arg: OffsetDateTime!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31T18:30:13" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -69,7 +69,7 @@ public void ParsesLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"2020-12-31T18:30:13+02\") }") .Build()); - Assert.Equal("2020-12-31T18:40:13+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -79,7 +79,7 @@ public void ParsesLiteralWithMinutes() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"2020-12-31T18:30:13+02:35\") }") .Build()); - Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -89,12 +89,12 @@ public void DoesntParseIncorrectLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"2020-12-31T18:30:13\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to OffsetDateTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeRfc3339IntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeRfc3339IntegrationTests.cs index d164c6c8587..9763a8c9d4c 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeRfc3339IntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeRfc3339IntegrationTests.cs @@ -21,7 +21,7 @@ public void QueryReturns() Assert.Equal( "2020-12-31T18:30:13.000001234+02:00", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -31,7 +31,7 @@ public void QueryReturnsWithMinutes() Assert.Equal( "2020-12-31T18:30:13.000001234+02:30", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -45,7 +45,7 @@ public void ParsesVariable() Assert.Equal( "2020-12-31T18:40:13.000001234+02:00", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -57,7 +57,7 @@ public void ParsesVariableWithMinutes() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31T18:30:13+02:35" }, }) .Build()); - Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -69,8 +69,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31T18:30:13" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -83,7 +83,7 @@ public void ParsesLiteral() Assert.Equal( "2020-12-31T18:40:13.000001234+02:00", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -94,7 +94,7 @@ public void ParsesLiteralWithMinutes() .SetDocument("mutation { test(arg: \"2020-12-31T18:30:13+02:35\") }") .Build()); - Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -105,12 +105,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-12-31T18:30:13\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to OffsetDateTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeTests.cs index 0a2cf75cb32..9e0ac126fbd 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTimeTypeTests.cs @@ -58,7 +58,7 @@ public void QueryReturns() { var result = _testExecutor.Execute("query { test: hours }"); - Assert.Equal("2020-12-31T18:30:13+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:30:13+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -66,7 +66,7 @@ public void QueryReturnsWithMinutes() { var result = _testExecutor.Execute("query { test: hoursAndMinutes }"); - Assert.Equal("2020-12-31T18:30:13+02:30", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:30:13+02:30", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -79,7 +79,7 @@ public void ParsesVariable() .SetVariableValues(new Dictionary<string, object?> { { "arg", "2020-12-31T18:30:13+02" }, }) .Build()); - Assert.Equal("2020-12-31T18:40:13+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -92,7 +92,7 @@ public void ParsesVariableWithMinutes() .SetVariableValues(new Dictionary<string, object?> { { "arg", "2020-12-31T18:30:13+02:35" }, }) .Build()); - Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -105,8 +105,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { { "arg", "2020-12-31T18:30:13" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -118,7 +118,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"2020-12-31T18:30:13+02\") }") .Build()); - Assert.Equal("2020-12-31T18:40:13+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -130,7 +130,7 @@ public void ParsesLiteralWithMinutes() .SetDocument("mutation { test(arg: \"2020-12-31T18:30:13+02:35\") }") .Build()); - Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:40:13+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -142,12 +142,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-12-31T18:30:13\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to OffsetDateTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } [Fact] diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTypeFullRoundtripIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTypeFullRoundtripIntegrationTests.cs index af2a67f7cfa..6f61b4f61be 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTypeFullRoundtripIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTypeFullRoundtripIntegrationTests.cs @@ -19,7 +19,7 @@ public void QueryReturns() { var result = _testExecutor.Execute("query { test: hours }"); - Assert.Equal("2020-12-31+02 (Gregorian)", result.ExpectQueryResult()!.Data!["test"]); + Assert.Equal("2020-12-31+02 (Gregorian)", result.ExpectSingleResult()!.Data!["test"]); } [Fact] @@ -27,7 +27,7 @@ public void QueryReturnsWithMinutes() { var result = _testExecutor.Execute("query { test: hoursAndMinutes }"); - Assert.Equal("2020-12-31+02:35 (Gregorian)", result.ExpectQueryResult()!.Data!["test"]); + Assert.Equal("2020-12-31+02:35 (Gregorian)", result.ExpectSingleResult()!.Data!["test"]); } [Fact] @@ -39,7 +39,7 @@ public void ParsesVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31+02 (Gregorian)" }, }) .Build()); - Assert.Equal("2020-12-31+02 (Gregorian)", result.ExpectQueryResult()!.Data!["test"]); + Assert.Equal("2020-12-31+02 (Gregorian)", result.ExpectSingleResult()!.Data!["test"]); } [Fact] @@ -51,7 +51,7 @@ public void ParsesVariableWithMinutes() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31+02:35 (Gregorian)" }, }) .Build()); - Assert.Equal("2020-12-31+02:35 (Gregorian)", result.ExpectQueryResult()!.Data!["test"]); + Assert.Equal("2020-12-31+02:35 (Gregorian)", result.ExpectSingleResult()!.Data!["test"]); } [Fact] @@ -63,8 +63,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31 (Gregorian)" }, }) .Build()); - Assert.Null(result.ExpectQueryResult()!.Data); - Assert.Single(result.ExpectQueryResult()!.Errors!); + Assert.Null(result.ExpectSingleResult()!.Data); + Assert.Single(result.ExpectSingleResult()!.Errors!); } [Fact] @@ -75,7 +75,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"2020-12-31+02 (Gregorian)\") }") .Build()); - Assert.Equal("2020-12-31+02 (Gregorian)", result.ExpectQueryResult()!.Data!["test"]); + Assert.Equal("2020-12-31+02 (Gregorian)", result.ExpectSingleResult()!.Data!["test"]); } [Fact] @@ -86,7 +86,7 @@ public void ParsesLiteralWithMinutes() .SetDocument("mutation { test(arg: \"2020-12-31+02:35 (Gregorian)\") }") .Build()); - Assert.Equal("2020-12-31+02:35 (Gregorian)", result.ExpectQueryResult()!.Data!["test"]); + Assert.Equal("2020-12-31+02:35 (Gregorian)", result.ExpectSingleResult()!.Data!["test"]); } [Fact] @@ -97,12 +97,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-12-31 (Gregorian)\") }") .Build()); - Assert.Null(result.ExpectQueryResult()!.Data); - Assert.Single(result.ExpectQueryResult()!.Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult()!.Data); + Assert.Single(result.ExpectSingleResult()!.Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to OffsetDate", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTypeTests.cs index 81063130e47..b19ca4de995 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetDateTypeTests.cs @@ -38,14 +38,14 @@ public class Mutation public void QueryReturns() { var result = _testExecutor.Execute("query { test: hours }"); - Assert.Equal("2020-12-31+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31+02", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsWithMinutes() { var result = _testExecutor.Execute("query { test: hoursAndMinutes }"); - Assert.Equal("2020-12-31+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -56,7 +56,7 @@ public void ParsesVariable() .SetDocument("mutation($arg: OffsetDate!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31+02" }, }) .Build()); - Assert.Equal("2020-12-31+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -67,7 +67,7 @@ public void ParsesVariableWithMinutes() .SetDocument("mutation($arg: OffsetDate!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31+02:35" }, }) .Build()); - Assert.Equal("2020-12-31+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -78,8 +78,8 @@ public void DoesntParseAnIncorrectVariable() .SetDocument("mutation($arg: OffsetDate!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -89,7 +89,7 @@ public void ParsesLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"2020-12-31+02\") }") .Build()); - Assert.Equal("2020-12-31+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -99,7 +99,7 @@ public void ParsesLiteralWithMinutes() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"2020-12-31+02:35\") }") .Build()); - Assert.Equal("2020-12-31+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -109,12 +109,12 @@ public void DoesntParseIncorrectLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"2020-12-31\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to OffsetDate", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } [Fact] diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeExtendedIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeExtendedIntegrationTests.cs index 44c0d69a4d2..824912645a0 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeExtendedIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeExtendedIntegrationTests.cs @@ -19,7 +19,7 @@ public void QueryReturns() { var result = _testExecutor.Execute("query { test: hours }"); - Assert.Equal("18:30:13.010011234+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -27,7 +27,7 @@ public void QueryReturnsWithMinutes() { var result = _testExecutor.Execute("query { test: hoursAndMinutes }"); - Assert.Equal("18:30:13.010011234+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -39,7 +39,7 @@ public void ParsesVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "18:30:13.010011234+02" }, }) .Build()); - Assert.Equal("18:30:13.010011234+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -51,7 +51,7 @@ public void ParsesVariableWithMinutes() .SetVariableValues(new Dictionary<string, object?> { {"arg", "18:30:13.010011234+02:35" }, }) .Build()); - Assert.Equal("18:30:13.010011234+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -63,8 +63,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "18:30:13.010011234" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -75,7 +75,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"18:30:13.010011234+02\") }") .Build()); - Assert.Equal("18:30:13.010011234+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -86,7 +86,7 @@ public void ParsesLiteralWithMinutes() .SetDocument("mutation { test(arg: \"18:30:13.010011234+02:35\") }") .Build()); - Assert.Equal("18:30:13.010011234+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -97,12 +97,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"18:30:13.010011234\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to OffsetTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeRfc3339IntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeRfc3339IntegrationTests.cs index 91de931f7f1..8dd9451ec9d 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeRfc3339IntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeRfc3339IntegrationTests.cs @@ -17,14 +17,14 @@ public class OffsetTimeTypeRfc3339IntegrationTests public void QueryReturns() { var result = _testExecutor.Execute("query { test: hours }"); - Assert.Equal("18:30:13.010011234+02:00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02:00", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsWithMinutes() { var result = _testExecutor.Execute("query { test: hoursAndMinutes }"); - Assert.Equal("18:30:13.010011234+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -36,7 +36,7 @@ public void ParsesVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "18:30:13.010011234+02:00" }, }) .Build()); - Assert.Equal("18:30:13.010011234+02:00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02:00", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -47,7 +47,7 @@ public void ParsesVariableWithMinutes() .SetDocument("mutation($arg: OffsetTime!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "18:30:13.010011234+02:35" }, }) .Build()); - Assert.Equal("18:30:13.010011234+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -58,8 +58,8 @@ public void DoesntParseAnIncorrectVariable() .SetDocument("mutation($arg: OffsetTime!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "18:30:13.010011234+02" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -69,7 +69,7 @@ public void ParsesLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"18:30:13.010011234+02:00\") }") .Build()); - Assert.Equal("18:30:13.010011234+02:00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02:00", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -79,7 +79,7 @@ public void ParsesLiteralWithMinutes() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"18:30:13.010011234+02:35\") }") .Build()); - Assert.Equal("18:30:13.010011234+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13.010011234+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -89,12 +89,12 @@ public void DoesntParseIncorrectLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"18:30:13.010011234+02\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to OffsetTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeTests.cs index 12fa3e6e22a..2c816eb4b0a 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTimeTypeTests.cs @@ -42,14 +42,14 @@ public class Mutation public void QueryReturns() { var result = _testExecutor.Execute("query { test: hours }"); - Assert.Equal("18:30:13+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13+02", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsWithMinutes() { var result = _testExecutor.Execute("query { test: hoursAndMinutes }"); - Assert.Equal("18:30:13+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -60,7 +60,7 @@ public void ParsesVariable() .SetDocument("mutation($arg: OffsetTime!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "18:30:13+02" }, }) .Build()); - Assert.Equal("18:30:13+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -71,7 +71,7 @@ public void ParsesVariableWithMinutes() .SetDocument("mutation($arg: OffsetTime!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "18:30:13+02:35" }, }) .Build()); - Assert.Equal("18:30:13+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -82,8 +82,8 @@ public void DoesntParseAnIncorrectVariable() .SetDocument("mutation($arg: OffsetTime!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "18:30:13" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -93,7 +93,7 @@ public void ParsesLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"18:30:13+02\") }") .Build()); - Assert.Equal("18:30:13+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13+02", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -103,7 +103,7 @@ public void ParsesLiteralWithMinutes() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"18:30:13+02:35\") }") .Build()); - Assert.Equal("18:30:13+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("18:30:13+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -114,12 +114,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"18:30:13\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to OffsetTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } [Fact] diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTypeGeneralInvariantWithoutZIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTypeGeneralInvariantWithoutZIntegrationTests.cs index 82cda4d643e..aaeda9c367f 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTypeGeneralInvariantWithoutZIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTypeGeneralInvariantWithoutZIntegrationTests.cs @@ -18,21 +18,21 @@ public class OffsetTypeGeneralInvariantWithoutZIntegrationTests public void QueryReturns() { var result = _testExecutor.Execute("query { test: hours }"); - Assert.Equal("+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+02", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsWithMinutes() { var result = _testExecutor.Execute("query { test: hoursAndMinutes }"); - Assert.Equal("+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsWithZ() { var result = _testExecutor.Execute("query { test: zOffset }"); - Assert.Equal("+00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+00", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -43,7 +43,7 @@ public void ParsesVariable() .SetDocument("mutation($arg: Offset!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "+02" }, }) .Build()); - Assert.Equal("+03:05", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+03:05", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -54,7 +54,7 @@ public void ParsesVariableWithMinutes() .SetDocument("mutation($arg: Offset!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "+02:35" }, }) .Build()); - Assert.Equal("+03:40", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+03:40", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -65,8 +65,8 @@ public void DoesntParseAnIncorrectVariable() .SetDocument("mutation($arg: Offset!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "18:30:13+02" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -77,7 +77,7 @@ public void ParsesLiteral() .SetDocument("mutation { test(arg: \"+02\") }") .Build()); - Assert.Equal("+03:05", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+03:05", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -87,7 +87,7 @@ public void ParsesLiteralWithMinutes() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"+02:35\") }") .Build()); - Assert.Equal("+03:40", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+03:40", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -97,7 +97,7 @@ public void ParsesLiteralWithZero() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"+00\") }") .Build()); - Assert.Equal("+01:05", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+01:05", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -107,12 +107,12 @@ public void DoesntParseLiteralWithZ() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"Z\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to Offset", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } [Fact] @@ -123,12 +123,12 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"18:30:13+02\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to Offset", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTypeTests.cs index 111e46d789d..0196956d9eb 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/OffsetTypeTests.cs @@ -32,21 +32,21 @@ public Offset Test(Offset arg) public void QueryReturns() { var result = _testExecutor.Execute("query { test: hours }"); - Assert.Equal("+02", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+02", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsWithMinutes() { var result = _testExecutor.Execute("query { test: hoursAndMinutes }"); - Assert.Equal("+02:35", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+02:35", result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsWithZ() { var result = _testExecutor.Execute("query { test: zOffset }"); - Assert.Equal("Z", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("Z", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -57,7 +57,7 @@ public void ParsesVariable() .SetDocument("mutation($arg: Offset!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "+02" }, }) .Build()); - Assert.Equal("+03:05", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+03:05", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -68,7 +68,7 @@ public void ParsesVariableWithMinutes() .SetDocument("mutation($arg: Offset!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "+02:35" }, }) .Build()); - Assert.Equal("+03:40", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+03:40", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -79,8 +79,8 @@ public void DoesntParseAnIncorrectVariable() .SetDocument("mutation($arg: Offset!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "18:30:13+02" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -90,7 +90,7 @@ public void ParsesLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"+02\") }") .Build()); - Assert.Equal("+03:05", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+03:05", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -100,7 +100,7 @@ public void ParsesLiteralWithMinutes() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"+02:35\") }") .Build()); - Assert.Equal("+03:40", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+03:40", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -110,7 +110,7 @@ public void ParsesLiteralWithZ() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"Z\") }") .Build()); - Assert.Equal("+01:05", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("+01:05", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -120,12 +120,12 @@ public void DoesntParseIncorrectLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"18:30:13+02\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to Offset", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } [Fact] diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/PeriodTypeNormalizingIsoIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/PeriodTypeNormalizingIsoIntegrationTests.cs index 0d62df1b727..1d7d1986e9d 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/PeriodTypeNormalizingIsoIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/PeriodTypeNormalizingIsoIntegrationTests.cs @@ -17,7 +17,7 @@ public class PeriodTypeNormalizingIsoIntegrationTests public void QueryReturns() { var result = _testExecutor.Execute("query { test: one }"); - Assert.Equal("P-17DT-23H-59M-59.9999861S", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("P-17DT-23H-59M-59.9999861S", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -28,7 +28,7 @@ public void ParsesVariable() .SetDocument("mutation($arg: Period!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "P-17DT-23H-59M-59.9999861S" }, }) .Build()); - Assert.Equal("P-18DT-9M-59.9999861S", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("P-18DT-9M-59.9999861S", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -39,8 +39,8 @@ public void DoesntParseAnIncorrectVariable() .SetDocument("mutation($arg: Period!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "-P-17DT-23H-59M-59.9999861S" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -50,7 +50,7 @@ public void ParsesLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"P-17DT-23H-59M-59.9999861S\") }") .Build()); - Assert.Equal("P-18DT-9M-59.9999861S", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("P-18DT-9M-59.9999861S", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -60,12 +60,12 @@ public void DoesntParseIncorrectLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"-P-17DT-23H-59M-59.9999861S\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to Period", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/PeriodTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/PeriodTypeTests.cs index 597dde745d7..302af021c5d 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/PeriodTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/PeriodTypeTests.cs @@ -32,7 +32,7 @@ public Period Test(Period arg) public void QueryReturns() { var result = _testExecutor.Execute("query { test: one }"); - Assert.Equal("P-3W3DT139t", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("P-3W3DT139t", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -43,7 +43,7 @@ public void ParsesVariable() .SetDocument("mutation($arg: Period!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "P-3W15DT139t" }, }) .Build()); - Assert.Equal("P-3W15DT-10M139t", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("P-3W15DT-10M139t", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -54,8 +54,8 @@ public void DoesntParseAnIncorrectVariable() .SetDocument("mutation($arg: Period!) { test(arg: $arg) }") .SetVariableValues(new Dictionary<string, object?> { {"arg", "-3W3DT-10M139t" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -65,7 +65,7 @@ public void ParsesLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"P-3W15DT139t\") }") .Build()); - Assert.Equal("P-3W15DT-10M139t", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("P-3W15DT-10M139t", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -75,12 +75,12 @@ public void DoesntParseIncorrectLiteral() .Execute(OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"-3W3DT-10M139t\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to Period", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } [Fact] diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/ZonedDateTimeTypeCustomIntegrationTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/ZonedDateTimeTypeCustomIntegrationTests.cs index 2e09797cd02..1e887765aed 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/ZonedDateTimeTypeCustomIntegrationTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/ZonedDateTimeTypeCustomIntegrationTests.cs @@ -29,14 +29,14 @@ public void QueryReturns() var result = _testExecutor.Execute("query { test: rome }"); Assert.Equal( "2020-12-31T18:30:13 Asia/Kathmandu (+05:45)", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] public void QueryReturnsUtc() { var result = _testExecutor.Execute("query { test: utc }"); - Assert.Equal("2020-12-31T18:30:13 UTC (+00)", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T18:30:13 UTC (+00)", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -50,7 +50,7 @@ public void ParsesVariable() Assert.Equal( "2020-12-31T19:40:13 Asia/Kathmandu (+05:45)", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -62,7 +62,7 @@ public void ParsesVariableWithUTC() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31T19:30:13 UTC (+00)" }, }) .Build()); - Assert.Equal("2020-12-31T19:40:13 UTC (+00)", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T19:40:13 UTC (+00)", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -74,8 +74,8 @@ public void DoesntParseAnIncorrectVariable() .SetVariableValues(new Dictionary<string, object?> { {"arg", "2020-12-31T19:30:13 (UTC)" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -92,7 +92,7 @@ public void ParsesLiteral() Assert.Equal( "2020-12-31T19:40:13 Asia/Kathmandu (+05:45)", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -103,7 +103,7 @@ public void ParsesLiteralWithUtc() .SetDocument("mutation { test(arg: \"2020-12-31T19:30:13 UTC (+00)\") }") .Build()); - Assert.Equal("2020-12-31T19:40:13 UTC (+00)", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T19:40:13 UTC (+00)", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -114,11 +114,11 @@ public void DoesntParseIncorrectLiteral() .SetDocument("mutation { test(arg: \"2020-12-31T19:30:13 (UTC)\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to ZonedDateTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } } diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/ZonedDateTimeTypeTests.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/ZonedDateTimeTypeTests.cs index 1f62e41fe5e..57d223ef725 100644 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/ZonedDateTimeTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.NodaTime.Tests/ZonedDateTimeTypeTests.cs @@ -106,8 +106,8 @@ public void DoesntParseAnIncorrectVariable() { "arg", "2020-12-31T19:30:13 UTC" }, }) .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); } [Fact] @@ -120,7 +120,7 @@ public void ParsesLiteral() .Build()); Assert.Equal( "2020-12-31T19:40:13 Asia/Kathmandu +05:45", - result.ExpectQueryResult().Data!["test"]); + result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -131,7 +131,7 @@ public void ParsesLiteralWithUtc() OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"2020-12-31T19:30:13 UTC +00\") }") .Build()); - Assert.Equal("2020-12-31T19:40:13 UTC +00", result.ExpectQueryResult().Data!["test"]); + Assert.Equal("2020-12-31T19:40:13 UTC +00", result.ExpectSingleResult().Data!["test"]); } [Fact] @@ -142,12 +142,12 @@ public void DoesntParseIncorrectLiteral() OperationRequestBuilder.New() .SetDocument("mutation { test(arg: \"2020-12-31T19:30:13 UTC\") }") .Build()); - Assert.Null(result.ExpectQueryResult().Data); - Assert.Single(result.ExpectQueryResult().Errors!); - Assert.Null(result.ExpectQueryResult().Errors![0].Code); + Assert.Null(result.ExpectSingleResult().Data); + Assert.Single(result.ExpectSingleResult().Errors!); + Assert.Null(result.ExpectSingleResult().Errors![0].Code); Assert.Equal( "Unable to deserialize string to ZonedDateTime", - result.ExpectQueryResult().Errors![0].Message); + result.ExpectSingleResult().Errors![0].Message); } [Fact] diff --git a/src/HotChocolate/Core/test/Types.Tests/Regressions/NestedOptionalInt_2114.cs b/src/HotChocolate/Core/test/Types.Tests/Regressions/NestedOptionalInt_2114.cs index 4a7f6e26859..af219da0ac7 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Regressions/NestedOptionalInt_2114.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Regressions/NestedOptionalInt_2114.cs @@ -32,7 +32,7 @@ public async Task ShouldNotFailWithExplicitValues() var result = await executor.ExecuteAsync(Query); // assert - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); Verify(input); } @@ -86,7 +86,7 @@ mutation a($input: ButterPickleInput!) }); // assert - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); Verify(input); } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs index 216430358dc..2e026dfc082 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs @@ -59,7 +59,7 @@ public async Task Output_Return_ObjectCyclic() var executor = schema.MakeExecutable(); // act - var result = (await executor.ExecuteAsync("{ fooCyclic }")).ExpectQueryResult(); + var result = (await executor.ExecuteAsync("{ fooCyclic }")).ExpectSingleResult(); // assert Assert.Equal("Cycle in object graph detected.", result.Errors?.Single().Exception?.Message); @@ -113,7 +113,7 @@ public async Task Output_Return_ListCyclic() var executor = schema.MakeExecutable(); // act - var result = (await executor.ExecuteAsync("{ fooCyclic }")).ExpectQueryResult(); + var result = (await executor.ExecuteAsync("{ fooCyclic }")).ExpectSingleResult(); // assert Assert.Equal("Cycle in object graph detected.", result.Errors?.Single().Exception?.Message); diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/SubscriptionTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/SubscriptionTypeTests.cs index 2a8a68a61f3..bdbdbc86248 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/SubscriptionTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/SubscriptionTypeTests.cs @@ -285,7 +285,7 @@ public async Task SubscribeAndResolve_Attribute_ISourceStream(string field) var mutationResult = await executor.ExecuteAsync( "mutation { writeBoolean(userId: \"1\" message: true) }", ct); - Assert.Null(mutationResult.ExpectQueryResult().Errors); + Assert.Null(mutationResult.ExpectSingleResult().Errors); await foreach (var queryResult in subscriptionResult.ExpectResponseStream() .ReadResultsAsync().WithCancellation(ct)) @@ -416,7 +416,7 @@ public async Task Subscribe_Attribute_With_Argument_Topic() var mutationResult = await executor.ExecuteAsync( "mutation { writeMessage(userId: \"abc\" message: \"def\") }", ct); - Assert.Null(mutationResult.ExpectQueryResult().Errors); + Assert.Null(mutationResult.ExpectSingleResult().Errors); await foreach (var queryResult in results.WithCancellation(ct).ConfigureAwait(false)) @@ -450,7 +450,7 @@ public async Task Subscribe_Attribute_With_Static_Topic_Defined_On_Attribute() var mutationResult = await executor.ExecuteAsync( "mutation { writeFixedMessage(message: \"def\") }", ct); - Assert.Null(mutationResult.ExpectQueryResult().Errors); + Assert.Null(mutationResult.ExpectSingleResult().Errors); await foreach (var queryResult in results.WithCancellation(ct).ConfigureAwait(false)) @@ -484,7 +484,7 @@ public async Task Subscribe_Attribute_With_Static_Topic() var mutationResult = await executor.ExecuteAsync( "mutation { writeSysMessage(message: \"def\") }", ct); - Assert.Null(mutationResult.ExpectQueryResult().Errors); + Assert.Null(mutationResult.ExpectSingleResult().Errors); await foreach (var queryResult in results.WithCancellation(ct).ConfigureAwait(false)) @@ -518,7 +518,7 @@ public async Task Subscribe_Attribute_With_Static_Topic_Infer_Topic() var mutationResult = await executor.ExecuteAsync( "mutation { writeOnInferTopic(message: \"def\") }", ct); - Assert.Null(mutationResult.ExpectQueryResult().Errors); + Assert.Null(mutationResult.ExpectSingleResult().Errors); await foreach (var queryResult in results.WithCancellation(ct).ConfigureAwait(false)) @@ -552,7 +552,7 @@ public async Task Subscribe_Attribute_With_Explicitly_Defined_Subscribe() var mutationResult = await executor.ExecuteAsync( "mutation { writeOnExplicit(message: \"def\") }", ct); - Assert.Null(mutationResult.ExpectQueryResult().Errors); + Assert.Null(mutationResult.ExpectSingleResult().Errors); await foreach (var queryResult in results.WithCancellation(ct).ConfigureAwait(false)) diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/SpecificationExampleTests.cs b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/SpecificationExampleTests.cs index 7fc345fd885..8e8113a2627 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/SpecificationExampleTests.cs +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/SpecificationExampleTests.cs @@ -38,7 +38,7 @@ query Example { // act var result = await requestExecutor.ExecuteAsync(request); - var queryResult = result.ExpectQueryResult(); + var queryResult = result.ExpectSingleResult(); // assert await snapshot diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/StaticQueryAnalysisTests.cs b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/StaticQueryAnalysisTests.cs index b8ec1478bc3..b31fe2a8648 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/StaticQueryAnalysisTests.cs +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/StaticQueryAnalysisTests.cs @@ -54,7 +54,7 @@ type Example { // assert await snapshot .Add(Utf8GraphQLParser.Parse(operation), "Query") - .AddResult(result.ExpectQueryResult(), "Result") + .AddResult(result.ExpectSingleResult(), "Result") .Add(schema, "Schema") .MatchMarkdownAsync(); } @@ -139,7 +139,7 @@ type PageInfo { // assert await snapshot .Add(Utf8GraphQLParser.Parse(operation), "Query") - .AddResult(result.ExpectQueryResult(), "Result") + .AddResult(result.ExpectSingleResult(), "Result") .Add(schema, "Schema") .MatchMarkdownAsync(); } diff --git a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/RequestExecutorBuilderExtensions.cs b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/RequestExecutorBuilderExtensions.cs index 3ed12e0661a..6e5d3d4a518 100644 --- a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/RequestExecutorBuilderExtensions.cs +++ b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/RequestExecutorBuilderExtensions.cs @@ -44,7 +44,7 @@ public static IRequestExecutorBuilder UseSqlLogging(this IRequestExecutorBuilder { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .SetContextData("expression", expression) .Build(); diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/FilterVisitorTestBase.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/FilterVisitorTestBase.cs index a426c6e890c..53b92a556bf 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/FilterVisitorTestBase.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/FilterVisitorTestBase.cs @@ -87,7 +87,7 @@ protected IRequestExecutor CreateSchema<TEntity, T>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .Build(); } diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/ProjectionVisitorTestBase.cs b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/ProjectionVisitorTestBase.cs index bef854ae3d6..01cd9805a1f 100644 --- a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/ProjectionVisitorTestBase.cs +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/ProjectionVisitorTestBase.cs @@ -101,7 +101,7 @@ public IRequestExecutor CreateSchema<TEntity>( if (context.ContextData.TryGetValue("sql", out var queryString)) { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .Build(); } diff --git a/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/SortVisitorTestBase.cs b/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/SortVisitorTestBase.cs index 5c625447b15..859e58780aa 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/SortVisitorTestBase.cs +++ b/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/SortVisitorTestBase.cs @@ -76,7 +76,7 @@ protected IRequestExecutor CreateSchema<TEntity, T>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .Build(); } diff --git a/src/HotChocolate/Fusion/test/Core.Tests/DataTests.cs b/src/HotChocolate/Fusion/test/Core.Tests/DataTests.cs index d25acc3de6e..1907ce39d14 100644 --- a/src/HotChocolate/Fusion/test/Core.Tests/DataTests.cs +++ b/src/HotChocolate/Fusion/test/Core.Tests/DataTests.cs @@ -60,6 +60,6 @@ query GetUser { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } } diff --git a/src/HotChocolate/Fusion/test/Core.Tests/DemoIntegrationTests.cs b/src/HotChocolate/Fusion/test/Core.Tests/DemoIntegrationTests.cs index 83aeac882af..fc5e7bec371 100644 --- a/src/HotChocolate/Fusion/test/Core.Tests/DemoIntegrationTests.cs +++ b/src/HotChocolate/Fusion/test/Core.Tests/DemoIntegrationTests.cs @@ -101,7 +101,7 @@ query GetUser { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -154,7 +154,7 @@ author @skip(if: $skip) { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -208,7 +208,7 @@ errorField @skip(if: $skip) CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -253,7 +253,7 @@ query GetUser { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -298,8 +298,8 @@ query GetUser { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.NotNull(result.ExpectQueryResult().Errors); - Assert.NotEmpty(result.ExpectQueryResult().Errors!); + Assert.NotNull(result.ExpectSingleResult().Errors); + Assert.NotEmpty(result.ExpectSingleResult().Errors!); } [Fact] @@ -563,7 +563,7 @@ query GetUser { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact(Skip = "Do we want to reformat ids?")] @@ -613,7 +613,7 @@ query ReformatIds { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact(Skip = "this does not work yet")] @@ -663,7 +663,7 @@ query ReformatIds { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -714,7 +714,7 @@ query GetUser { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -766,7 +766,7 @@ query TopProducts { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -819,7 +819,7 @@ query TopProducts { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -866,7 +866,7 @@ query TopProducts($first: Int!) { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -922,7 +922,7 @@ query Introspect { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -974,7 +974,7 @@ ... on User { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1074,7 +1074,7 @@ ... on User { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1179,7 +1179,7 @@ ... on User { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1296,7 +1296,7 @@ query Introspect { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1348,7 +1348,7 @@ query ProductReviews( CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1405,7 +1405,7 @@ public async Task Forward_Nested_Variables_No_OpName() CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1461,7 +1461,7 @@ public async Task Forward_Nested_Variables_No_OpName_Two_RootSelections() CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1515,7 +1515,7 @@ ... on Product { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1571,7 +1571,7 @@ query ProductReviews( CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1631,7 +1631,7 @@ query Requires { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1690,7 +1690,7 @@ query Requires { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1755,7 +1755,7 @@ query Large { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1802,7 +1802,7 @@ query AfterNull($after: String) { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -1858,7 +1858,7 @@ query TopProducts { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } // TODO : FIX THIS TEST diff --git a/src/HotChocolate/Fusion/test/Core.Tests/InterfaceTests.cs b/src/HotChocolate/Fusion/test/Core.Tests/InterfaceTests.cs index 9015d61d75d..76e80a6944d 100644 --- a/src/HotChocolate/Fusion/test/Core.Tests/InterfaceTests.cs +++ b/src/HotChocolate/Fusion/test/Core.Tests/InterfaceTests.cs @@ -66,7 +66,7 @@ query Appointments { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -119,7 +119,7 @@ ... on Patient1 { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } [Fact] @@ -174,6 +174,6 @@ ... on Patient1 { CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } } diff --git a/src/HotChocolate/Fusion/test/Core.Tests/IntrospectionTests.cs b/src/HotChocolate/Fusion/test/Core.Tests/IntrospectionTests.cs index 1b92ae57005..37e1c1e18a4 100644 --- a/src/HotChocolate/Fusion/test/Core.Tests/IntrospectionTests.cs +++ b/src/HotChocolate/Fusion/test/Core.Tests/IntrospectionTests.cs @@ -50,6 +50,6 @@ public async Task ShortCircuit_RootTypeName_Requests() CollectSnapshotData(snapshot, request, result); await snapshot.MatchMarkdownAsync(); - Assert.Null(result.ExpectQueryResult().Errors); + Assert.Null(result.ExpectSingleResult().Errors); } } diff --git a/src/HotChocolate/Marten/test/Data.Marten.Filters.Tests/FilterVisitorTestBase.cs b/src/HotChocolate/Marten/test/Data.Marten.Filters.Tests/FilterVisitorTestBase.cs index 5640fb7716f..06b17098a30 100644 --- a/src/HotChocolate/Marten/test/Data.Marten.Filters.Tests/FilterVisitorTestBase.cs +++ b/src/HotChocolate/Marten/test/Data.Marten.Filters.Tests/FilterVisitorTestBase.cs @@ -69,7 +69,7 @@ protected IRequestExecutor CreateSchema<TEntity, T>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .Build(); } diff --git a/src/HotChocolate/Marten/test/Data.Marten.Sorting.Tests/SortVisitorTestBase.cs b/src/HotChocolate/Marten/test/Data.Marten.Sorting.Tests/SortVisitorTestBase.cs index 31d066af9cc..bdc8bc8aceb 100644 --- a/src/HotChocolate/Marten/test/Data.Marten.Sorting.Tests/SortVisitorTestBase.cs +++ b/src/HotChocolate/Marten/test/Data.Marten.Sorting.Tests/SortVisitorTestBase.cs @@ -126,7 +126,7 @@ protected IRequestExecutor CreateSchema<TEntity, T>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/FilterVisitorTestBase.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/FilterVisitorTestBase.cs index 1106ecc248c..5afd32d9c47 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/FilterVisitorTestBase.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/FilterVisitorTestBase.cs @@ -61,7 +61,7 @@ protected IRequestExecutor CreateSchema<TEntity, T>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbAggregateFluentTests.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbAggregateFluentTests.cs index 22e2ed94fa7..4f636ecc191 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbAggregateFluentTests.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbAggregateFluentTests.cs @@ -148,7 +148,7 @@ private static IRequestExecutor CreateSchema<TEntity>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbCollectionTests.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbCollectionTests.cs index 5860ba95c89..d6b91d5ddf9 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbCollectionTests.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbCollectionTests.cs @@ -147,7 +147,7 @@ private static IRequestExecutor CreateSchema<TEntity>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbFindFluentTests.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbFindFluentTests.cs index b9d75318438..4d954858567 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbFindFluentTests.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/MongoDbFindFluentTests.cs @@ -193,7 +193,7 @@ private static IRequestExecutor CreateSchema<TEntity>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbCursorPagingAggregateFluentTests.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbCursorPagingAggregateFluentTests.cs index 10b6434e3d8..c12301d2579 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbCursorPagingAggregateFluentTests.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbCursorPagingAggregateFluentTests.cs @@ -266,7 +266,7 @@ private ValueTask<IRequestExecutor> CreateSchemaAsync() { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbCursorPagingFindFluentTests.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbCursorPagingFindFluentTests.cs index ca00cdda9aa..4ae9689f99b 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbCursorPagingFindFluentTests.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbCursorPagingFindFluentTests.cs @@ -299,7 +299,7 @@ private ValueTask<IRequestExecutor> CreateSchemaAsync() { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbOffsetPagingAggregateTests.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbOffsetPagingAggregateTests.cs index 7f9787c3b73..bf74d04f0df 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbOffsetPagingAggregateTests.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbOffsetPagingAggregateTests.cs @@ -214,7 +214,7 @@ private ValueTask<IRequestExecutor> CreateSchemaAsync() { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbOffsetPagingFindFluentTests.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbOffsetPagingFindFluentTests.cs index 739f2c3bcbe..861d656c808 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbOffsetPagingFindFluentTests.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/MongoDbOffsetPagingFindFluentTests.cs @@ -212,7 +212,7 @@ private ValueTask<IRequestExecutor> CreateSchemaAsync() { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/VisitorTestBase.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/VisitorTestBase.cs index 010357a7708..0e8445a0683 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/VisitorTestBase.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/VisitorTestBase.cs @@ -66,7 +66,7 @@ protected IRequestExecutor CreateSchema<TEntity, T>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Projections.Tests/ProjectionVisitorTestBase.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Projections.Tests/ProjectionVisitorTestBase.cs index cea21f3d763..6e111e5205f 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Projections.Tests/ProjectionVisitorTestBase.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Projections.Tests/ProjectionVisitorTestBase.cs @@ -66,7 +66,7 @@ public IRequestExecutor CreateSchema<TEntity>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbAggregateFluentTests.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbAggregateFluentTests.cs index 55b0907f8fa..03179a80051 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbAggregateFluentTests.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbAggregateFluentTests.cs @@ -152,7 +152,7 @@ private static IRequestExecutor CreateSchema<TEntity>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbCollectionTests.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbCollectionTests.cs index e4e711800bb..ecb952f0e6a 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbCollectionTests.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbCollectionTests.cs @@ -152,7 +152,7 @@ private static IRequestExecutor CreateSchema<TEntity>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbFindFluentTests.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbFindFluentTests.cs index 15b74fa67f1..52931b4cbf7 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbFindFluentTests.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/MongoDbFindFluentTests.cs @@ -207,7 +207,7 @@ private static IRequestExecutor CreateSchema<TEntity>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/SortVisitorTestBase.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/SortVisitorTestBase.cs index c6e17eead7a..262bf7a3c12 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/SortVisitorTestBase.cs +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/SortVisitorTestBase.cs @@ -59,7 +59,7 @@ protected IRequestExecutor CreateSchema<TEntity, T>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/FilterVisitorTestBase.cs b/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/FilterVisitorTestBase.cs index cbb82d5ffc4..c128144761c 100644 --- a/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/FilterVisitorTestBase.cs +++ b/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/FilterVisitorTestBase.cs @@ -62,7 +62,7 @@ protected IRequestExecutor CreateSchema<TEntity, T>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .Build(); } diff --git a/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/RavenAsyncDocumentQueryTests.cs b/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/RavenAsyncDocumentQueryTests.cs index 674e1a1bbf0..e93ba593201 100644 --- a/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/RavenAsyncDocumentQueryTests.cs +++ b/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/RavenAsyncDocumentQueryTests.cs @@ -433,7 +433,7 @@ private ValueTask<IRequestExecutor> CreateSchemaAsync() { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/RavenDocumentQueryTests.cs b/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/RavenDocumentQueryTests.cs index 8be74fec7a2..4c054b574da 100644 --- a/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/RavenDocumentQueryTests.cs +++ b/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/RavenDocumentQueryTests.cs @@ -428,7 +428,7 @@ private ValueTask<IRequestExecutor> CreateSchemaAsync() if (context.ContextData.TryGetValue("query", out var queryString)) { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("query", queryString) .Build(); } diff --git a/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/VisitorTestBase.cs b/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/VisitorTestBase.cs index 70e4728304e..6302d017edd 100644 --- a/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/VisitorTestBase.cs +++ b/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/VisitorTestBase.cs @@ -68,7 +68,7 @@ protected IRequestExecutor CreateSchema<TEntity, T>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .Build(); } diff --git a/src/HotChocolate/Raven/test/Data.Raven.Projections.Tests/ProjectionVisitorTestBase.cs b/src/HotChocolate/Raven/test/Data.Raven.Projections.Tests/ProjectionVisitorTestBase.cs index a455b3079f9..48c0c8b7ea2 100644 --- a/src/HotChocolate/Raven/test/Data.Raven.Projections.Tests/ProjectionVisitorTestBase.cs +++ b/src/HotChocolate/Raven/test/Data.Raven.Projections.Tests/ProjectionVisitorTestBase.cs @@ -105,7 +105,7 @@ protected IRequestExecutor CreateSchema<TEntity>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .Build(); } diff --git a/src/HotChocolate/Raven/test/Data.Raven.Sorting.Tests/SortVisitorTestBase.cs b/src/HotChocolate/Raven/test/Data.Raven.Sorting.Tests/SortVisitorTestBase.cs index 68301becbfd..d530cbfad12 100644 --- a/src/HotChocolate/Raven/test/Data.Raven.Sorting.Tests/SortVisitorTestBase.cs +++ b/src/HotChocolate/Raven/test/Data.Raven.Sorting.Tests/SortVisitorTestBase.cs @@ -82,7 +82,7 @@ protected IRequestExecutor CreateSchema<TEntity, T>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .Build(); } diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/FilterVisitorTestBase.cs b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/FilterVisitorTestBase.cs index e93eede1e17..f32699d0f25 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/FilterVisitorTestBase.cs +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/FilterVisitorTestBase.cs @@ -86,7 +86,7 @@ protected async Task<IRequestExecutor> CreateSchemaAsync<TEntity, T>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .Build(); } diff --git a/src/HotChocolate/Spatial/test/Data.Projections.SqlServer.Tests/FilterVisitorTestBase.cs b/src/HotChocolate/Spatial/test/Data.Projections.SqlServer.Tests/FilterVisitorTestBase.cs index 356802f9d1e..cce63647fb1 100644 --- a/src/HotChocolate/Spatial/test/Data.Projections.SqlServer.Tests/FilterVisitorTestBase.cs +++ b/src/HotChocolate/Spatial/test/Data.Projections.SqlServer.Tests/FilterVisitorTestBase.cs @@ -74,7 +74,7 @@ protected async Task<IRequestExecutor> CreateSchemaAsync<TEntity>( { context.Result = OperationResultBuilder - .FromResult(context.Result!.ExpectQueryResult()) + .FromResult(context.Result!.ExpectSingleResult()) .SetContextData("sql", queryString) .Build(); } From e8078ed0cf2cac34678639346f0ec915af30dd4e Mon Sep 17 00:00:00 2001 From: Michael Staib <michael@chillicream.com> Date: Fri, 6 Sep 2024 19:06:42 +0200 Subject: [PATCH 2/2] Updated Snapshots --- src/Directory.Packages.props | 4 ++-- ...tpCachingTests.Default_Max_Age_Should_Apply_And_Cache.snap | 4 ++-- ...HttpCachingTests.Default_Scope_Should_Apply_And_Cache.snap | 2 +- .../HttpCachingTests.Just_Defaults_Should_Cache.snap | 4 ++-- .../HttpCachingTests.MaxAgeAndScope_Should_Cache.snap | 2 +- .../HttpCachingTests.MaxAge_NonZero_Should_Cache.snap | 4 ++-- .../HttpCachingTests.MaxAge_Zero_Should_Cache.snap | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 7fc6e8658ae..6a17b0df506 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -106,7 +106,7 @@ <PackageVersion Include="Microsoft.Extensions.Http" Version="7.0.0" /> <PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="7.0.0" /> <PackageVersion Include="Microsoft.Extensions.Options" Version="7.0.0" /> - <PackageVersion Include="Microsoft.Net.Http.Headers" Version="8.0.4" /> + <PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.2.0" /> <PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" /> <PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="7.0.0" /> <PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="7.0.0" /> @@ -129,7 +129,7 @@ <PackageVersion Include="Microsoft.Extensions.Http" Version="6.0.0" /> <PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="6.0.0" /> <PackageVersion Include="Microsoft.Extensions.Options" Version="6.0.0" /> - <PackageVersion Include="Microsoft.Net.Http.Headers" Version="8.0.4" /> + <PackageVersion Include="Microsoft.Net.Http.Headers" Version="2.2.0" /> <PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0" /> <PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="6.0.0" /> <PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="6.0.0" /> diff --git a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Default_Max_Age_Should_Apply_And_Cache.snap b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Default_Max_Age_Should_Apply_And_Cache.snap index e08d5e7bbe1..1537c24a358 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Default_Max_Age_Should_Apply_And_Cache.snap +++ b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Default_Max_Age_Should_Apply_And_Cache.snap @@ -3,7 +3,7 @@ { "Key": "Cache-Control", "Value": [ - "public, max-age=1000" + "max-age=1000" ] } ], @@ -15,5 +15,5 @@ ] } ], - "Body": "{}" + "Body": "{\"data\":{\"field\":\"\"}}" } diff --git a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Default_Scope_Should_Apply_And_Cache.snap b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Default_Scope_Should_Apply_And_Cache.snap index c351ebe2850..2cef0413fbf 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Default_Scope_Should_Apply_And_Cache.snap +++ b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Default_Scope_Should_Apply_And_Cache.snap @@ -15,5 +15,5 @@ ] } ], - "Body": "{}" + "Body": "{\"data\":{\"field\":\"\"}}" } diff --git a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Just_Defaults_Should_Cache.snap b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Just_Defaults_Should_Cache.snap index df9a816a9d3..8c2402b5538 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Just_Defaults_Should_Cache.snap +++ b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.Just_Defaults_Should_Cache.snap @@ -3,7 +3,7 @@ { "Key": "Cache-Control", "Value": [ - "public, max-age=0" + "max-age=0" ] } ], @@ -15,5 +15,5 @@ ] } ], - "Body": "{}" + "Body": "{\"data\":{\"field\":\"\"}}" } diff --git a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAgeAndScope_Should_Cache.snap b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAgeAndScope_Should_Cache.snap index 1393ba7514d..30e93764014 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAgeAndScope_Should_Cache.snap +++ b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAgeAndScope_Should_Cache.snap @@ -15,5 +15,5 @@ ] } ], - "Body": "{}" + "Body": "{\"data\":{\"field\":\"\"}}" } diff --git a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAge_NonZero_Should_Cache.snap b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAge_NonZero_Should_Cache.snap index 7f3281a8490..663a3206cc0 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAge_NonZero_Should_Cache.snap +++ b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAge_NonZero_Should_Cache.snap @@ -3,7 +3,7 @@ { "Key": "Cache-Control", "Value": [ - "public, max-age=2000" + "max-age=2000" ] } ], @@ -15,5 +15,5 @@ ] } ], - "Body": "{}" + "Body": "{\"data\":{\"field\":\"\"}}" } diff --git a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAge_Zero_Should_Cache.snap b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAge_Zero_Should_Cache.snap index df9a816a9d3..8c2402b5538 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAge_Zero_Should_Cache.snap +++ b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/HttpCachingTests.MaxAge_Zero_Should_Cache.snap @@ -3,7 +3,7 @@ { "Key": "Cache-Control", "Value": [ - "public, max-age=0" + "max-age=0" ] } ], @@ -15,5 +15,5 @@ ] } ], - "Body": "{}" + "Body": "{\"data\":{\"field\":\"\"}}" }