-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
157 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: .NET Core | ||
|
||
on: | ||
push: | ||
branches: [ master, develop ] | ||
pull_request: | ||
branches: [ master, develop ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: [windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.1.101 | ||
- name: Restore tools | ||
run: dotnet tool restore | ||
- name: Build | ||
run: dotnet build --configuration Release |
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
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
20 changes: 0 additions & 20 deletions
20
tests/SAHB.GraphQL.Client.Testserver/SAHB.GraphQL.Client.Testserver.csproj
This file was deleted.
Oops, something went wrong.
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,65 @@ | ||
using System.Runtime.Serialization; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using SAHB.GraphQLClient.FieldBuilder; | ||
using SAHB.GraphQLClient.FieldBuilder.Attributes; | ||
using SAHB.GraphQLClient.QueryGenerator; | ||
using Xunit; | ||
|
||
namespace SAHB.GraphQL.Client.Tests.Issues | ||
{ | ||
public class Issue98 | ||
{ | ||
private readonly IGraphQLQueryGeneratorFromFields queryGenerator = new GraphQLQueryGeneratorFromFields(); | ||
private readonly IGraphQLFieldBuilder fieldBuilder = new GraphQLFieldBuilder(); | ||
|
||
[Fact] | ||
public void Generates_Expected_Query() | ||
{ | ||
// Arrange | ||
var expectedQuery = "{\"query\":\"query($foo:FooNumber){foobeta(foo:$foo){id}}\",\"variables\":{\"foo\":{\"fooNumber\":\"123456\",\"systemCode\":\"BAZ\"}}}"; | ||
|
||
// Act | ||
var selectionSet = fieldBuilder.GenerateSelectionSet(typeof(FooQuery)); | ||
var actualQuery = queryGenerator.GenerateQuery( | ||
GraphQLOperationType.Query, | ||
selectionSet, | ||
new GraphQLQueryArgument("foo", new FooNumber { Number = "123456", SystemCode = FooSystemType.BAZ })); | ||
|
||
// Assert | ||
Assert.Equal(expectedQuery, actualQuery); | ||
} | ||
|
||
public class FooNumber | ||
{ | ||
[JsonProperty("fooNumber")] | ||
public string Number { get; set; } | ||
|
||
[JsonProperty("systemCode")] | ||
public FooSystemType SystemCode { get; set; } | ||
} | ||
|
||
public class FooQuery | ||
{ | ||
[GraphQLArguments("foo", "FooNumber", "foo")] | ||
public FooBeta FooBeta { get; set; } | ||
} | ||
|
||
[GraphQLFieldName("foobeta")] | ||
public class FooBeta : Foo | ||
{ | ||
} | ||
|
||
public class Foo | ||
{ | ||
public string Id { get; set; } | ||
} | ||
|
||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum FooSystemType | ||
{ | ||
[EnumMember(Value = "BAZ")] | ||
BAZ, | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> | ||
<HasSharedItems>true</HasSharedItems> | ||
<SharedGUID>15808cc4-3bcf-46b2-9f16-b5251433ac6c</SharedGUID> | ||
</PropertyGroup> | ||
<PropertyGroup Label="Configuration"> | ||
<Import_RootNamespace>TestServer</Import_RootNamespace> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildThisFileDirectory)GraphQLWebApplicationFactory.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\CatOrDog\CatOrDogInterfaceSchema.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\CatOrDog\CatOrDogUnionSchema.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\Chat\ChatSchema.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\Chat\Data\Chat.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\Chat\Data\IChat.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\Chat\Data\Message.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\Chat\Data\MessageFrom.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\Chat\Data\ReceivedMessage.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\GenericQuerySchema.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\HelloArgument\HelloArgumentQuerySchema.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\HelloDeprecated\HelloDeprecatedQuerySchema.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\Hello\HelloMutationSchema.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)Schemas\Hello\HelloQuerySchema.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)TestserverStartup.cs" /> | ||
</ItemGroup> | ||
</Project> |
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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>15808cc4-3bcf-46b2-9f16-b5251433ac6c</ProjectGuid> | ||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion> | ||
</PropertyGroup> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" /> | ||
<PropertyGroup /> | ||
<Import Project="TestServer.projitems" Label="Shared" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" /> | ||
</Project> |
File renamed without changes.