-
-
Notifications
You must be signed in to change notification settings - Fork 748
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed internal field generation in Strawberry Shake (#3542)
- Loading branch information
1 parent
93d04a3
commit a217b70
Showing
10 changed files
with
16,485 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5,087 changes: 5,087 additions & 0 deletions
5,087
...neration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.Client.cs
Large diffs are not rendered by default.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
.../CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using HotChocolate.AspNetCore.Utilities; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Snapshooter.Xunit; | ||
using StrawberryShake.Transport.WebSockets; | ||
using Xunit; | ||
|
||
namespace StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection | ||
{ | ||
public class StarWarsIntrospectionTest : ServerTestBase | ||
{ | ||
public StarWarsIntrospectionTest(TestServerFactory serverFactory) : base(serverFactory) | ||
{ | ||
} | ||
|
||
[Fact] | ||
public async Task Execute_StarWarsIntrospection_Test() | ||
{ | ||
// arrange | ||
CancellationToken ct = new CancellationTokenSource(20_000).Token; | ||
using IWebHost host = TestServerHelper.CreateServer( | ||
_ => { }, | ||
out var port); | ||
var serviceCollection = new ServiceCollection(); | ||
serviceCollection.AddHttpClient( | ||
StarWarsIntrospectionClient.ClientName, | ||
c => c.BaseAddress = new Uri("http://localhost:" + port + "/graphql")); | ||
serviceCollection.AddWebSocketClient( | ||
StarWarsIntrospectionClient.ClientName, | ||
c => c.Uri = new Uri("ws://localhost:" + port + "/graphql")); | ||
serviceCollection.AddStarWarsIntrospectionClient(); | ||
IServiceProvider services = serviceCollection.BuildServiceProvider(); | ||
StarWarsIntrospectionClient client = services.GetRequiredService<StarWarsIntrospectionClient>(); | ||
|
||
// act | ||
IOperationResult<IIntrospectionQueryResult> result = | ||
await client.IntrospectionQuery.ExecuteAsync(ct); | ||
|
||
|
||
// assert | ||
result.MatchSnapshot(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.