コード例 #1
0
        public void InlineFragmentsRequestFact()
        {
            var graphQLRequest = GraphQLRequestConsts.InlineFragmentsRequest;

            AssertGraphQL.CorrectGraphQLRequest(graphQLRequest);
            Assert.NotNull(graphQLRequest.Variables);
            Assert.Equal("JEDI", graphQLRequest.Variables.ep);
        }
コード例 #2
0
        public void VariablesRequestFact()
        {
            var graphQLRequest = GraphQLRequestConsts.VariablesRequest;

            AssertGraphQL.CorrectGraphQLRequest(graphQLRequest);
            Assert.NotNull(graphQLRequest.Variables);
            Assert.Equal("JEDI", graphQLRequest.Variables.episode);
        }
コード例 #3
0
        public void MutationsResponseFact()
        {
            var graphQLResponse = GraphQLResponseConsts.MutationsResponse;

            AssertGraphQL.CorrectGraphQLResponse(graphQLResponse);

            Assert.Equal(5, graphQLResponse.Data.createReview.stars.Value);
            Assert.Equal("This is a great movie!", graphQLResponse.Data.createReview.commentary.Value);
        }
コード例 #4
0
        public void DirectivesRequestFact()
        {
            var graphQLRequest = GraphQLRequestConsts.DirectivesRequest;

            AssertGraphQL.CorrectGraphQLRequest(graphQLRequest);
            Assert.NotNull(graphQLRequest.Variables);
            Assert.Equal("JEDI", graphQLRequest.Variables.episode);
            Assert.Equal(false, graphQLRequest.Variables.withFriends);
        }
コード例 #5
0
        public void MutationsRequestFact()
        {
            var graphQLRequest = GraphQLRequestConsts.MutationsRequest;

            AssertGraphQL.CorrectGraphQLRequest(graphQLRequest);
            Assert.NotNull(graphQLRequest.Variables);
            Assert.Equal("JEDI", graphQLRequest.Variables.ep);
            Assert.Equal(5, graphQLRequest.Variables.review.stars);
            Assert.Equal("This is a great movie!", graphQLRequest.Variables.review.commentary);
        }
コード例 #6
0
        public void FieldsResponse1Fact()
        {
            var graphQLResponse = GraphQLResponseConsts.FieldsResponse1;

            AssertGraphQL.CorrectGraphQLResponse(graphQLResponse);

            Assert.Equal("R2-D2", graphQLResponse.Data.hero.name.Value);

            var hero = graphQLResponse.GetDataFieldAs <Person>("hero");

            Assert.Equal("R2-D2", hero.Name);
        }
コード例 #7
0
        public void MetaFieldsResponseFact()
        {
            var graphQLResponse = GraphQLResponseConsts.MetaFieldsResponse;

            AssertGraphQL.CorrectGraphQLResponse(graphQLResponse);

            Assert.Equal("Human", graphQLResponse.Data.search[0].__typename.Value);
            Assert.Equal("Han Solo", graphQLResponse.Data.search[0].name.Value);
            Assert.Equal("Human", graphQLResponse.Data.search[1].__typename.Value);
            Assert.Equal("Leia Organa", graphQLResponse.Data.search[1].name.Value);
            Assert.Equal("Starship", graphQLResponse.Data.search[2].__typename.Value);
            Assert.Equal("TIE Advanced x1", graphQLResponse.Data.search[2].name.Value);
        }
コード例 #8
0
        public void InlineFragmentsResponseFact()
        {
            var graphQLResponse = GraphQLResponseConsts.InlineFragmentsResponse;

            AssertGraphQL.CorrectGraphQLResponse(graphQLResponse);

            Assert.Equal("R2-D2", graphQLResponse.Data.hero.name.Value);
            Assert.Equal("Astromech", graphQLResponse.Data.hero.primaryFunction.Value);

            var hero = graphQLResponse.GetDataFieldAs <Person>("hero");

            Assert.Equal("R2-D2", hero.Name);
            Assert.Equal("Astromech", hero.PrimaryFunction);
        }
コード例 #9
0
        public void ArgumentsResponse2Fact()
        {
            var graphQLResponse = GraphQLResponseConsts.ArgumentsResponse2;

            AssertGraphQL.CorrectGraphQLResponse(graphQLResponse);

            Assert.Equal("Luke Skywalker", graphQLResponse.Data.human.name.Value);
            Assert.Equal(5.6430448, graphQLResponse.Data.human.height.Value);

            var human = graphQLResponse.GetDataFieldAs <Person>("human");

            Assert.Equal("Luke Skywalker", human.Name);
            Assert.Equal(5.6430448, human.Height);
        }
コード例 #10
0
        public void AliasesResponseFact()
        {
            var graphQLResponse = GraphQLResponseConsts.AliasesResponse;

            AssertGraphQL.CorrectGraphQLResponse(graphQLResponse);

            Assert.Equal("Luke Skywalker", graphQLResponse.Data.empireHero.name.Value);
            Assert.Equal("R2-D2", graphQLResponse.Data.jediHero.name.Value);

            var empireHero = graphQLResponse.GetDataFieldAs <Person>("empireHero");

            Assert.Equal("Luke Skywalker", empireHero.Name);

            var jediHero = graphQLResponse.GetDataFieldAs <Person>("jediHero");

            Assert.Equal("R2-D2", jediHero.Name);
        }
コード例 #11
0
        public void FieldsResponse2Fact()
        {
            var graphQLResponse = GraphQLResponseConsts.FieldsResponse2;

            AssertGraphQL.CorrectGraphQLResponse(graphQLResponse);

            Assert.Equal("R2-D2", graphQLResponse.Data.hero.name.Value);
            Assert.Equal("Luke Skywalker", graphQLResponse.Data.hero.friends[0].name.Value);
            Assert.Equal("Han Solo", graphQLResponse.Data.hero.friends[1].name.Value);
            Assert.Equal("Leia Organa", graphQLResponse.Data.hero.friends[2].name.Value);

            var hero = graphQLResponse.GetDataFieldAs <Person>("hero");

            Assert.Equal("R2-D2", hero.Name);
            Assert.Equal("Luke Skywalker", hero.Friends[0].Name);
            Assert.Equal("Han Solo", hero.Friends[1].Name);
            Assert.Equal("Leia Organa", hero.Friends[2].Name);
        }
コード例 #12
0
        public void FragmentsResponseFact()
        {
            var graphQLResponse = GraphQLResponseConsts.FragmentsResponse;

            AssertGraphQL.CorrectGraphQLResponse(graphQLResponse);

            Assert.Equal("Luke Skywalker", graphQLResponse.Data.leftComparison.name.Value);
            Assert.Equal("NEWHOPE", graphQLResponse.Data.leftComparison.appearsIn[0].Value);
            Assert.Equal("EMPIRE", graphQLResponse.Data.leftComparison.appearsIn[1].Value);
            Assert.Equal("JEDI", graphQLResponse.Data.leftComparison.appearsIn[2].Value);
            Assert.Equal("Han Solo", graphQLResponse.Data.leftComparison.friends[0].name.Value);
            Assert.Equal("Leia Organa", graphQLResponse.Data.leftComparison.friends[1].name.Value);
            Assert.Equal("C-3PO", graphQLResponse.Data.leftComparison.friends[2].name.Value);
            Assert.Equal("R2-D2", graphQLResponse.Data.leftComparison.friends[3].name.Value);

            Assert.Equal("R2-D2", graphQLResponse.Data.rightComparison.name.Value);
            Assert.Equal("NEWHOPE", graphQLResponse.Data.rightComparison.appearsIn[0].Value);
            Assert.Equal("EMPIRE", graphQLResponse.Data.rightComparison.appearsIn[1].Value);
            Assert.Equal("JEDI", graphQLResponse.Data.rightComparison.appearsIn[2].Value);
            Assert.Equal("Luke Skywalker", graphQLResponse.Data.rightComparison.friends[0].name.Value);
            Assert.Equal("Han Solo", graphQLResponse.Data.rightComparison.friends[1].name.Value);
            Assert.Equal("Leia Organa", graphQLResponse.Data.rightComparison.friends[2].name.Value);

            var leftComparison = graphQLResponse.GetDataFieldAs <Person>("leftComparison");

            Assert.Equal("Luke Skywalker", leftComparison.Name);
            Assert.Equal("NEWHOPE", leftComparison.AppearsIn[0]);
            Assert.Equal("EMPIRE", leftComparison.AppearsIn[1]);
            Assert.Equal("JEDI", leftComparison.AppearsIn[2]);
            Assert.Equal("Han Solo", leftComparison.Friends[0].Name);
            Assert.Equal("Leia Organa", leftComparison.Friends[1].Name);
            Assert.Equal("C-3PO", leftComparison.Friends[2].Name);
            Assert.Equal("R2-D2", leftComparison.Friends[3].Name);

            var rightComparison = graphQLResponse.GetDataFieldAs <Person>("rightComparison");

            Assert.Equal("R2-D2", rightComparison.Name);
            Assert.Equal("NEWHOPE", rightComparison.AppearsIn[0]);
            Assert.Equal("EMPIRE", rightComparison.AppearsIn[1]);
            Assert.Equal("JEDI", rightComparison.AppearsIn[2]);
            Assert.Equal("Luke Skywalker", rightComparison.Friends[0].Name);
            Assert.Equal("Han Solo", rightComparison.Friends[1].Name);
            Assert.Equal("Leia Organa", rightComparison.Friends[2].Name);
        }
コード例 #13
0
        public void MetaFieldsRequestFact()
        {
            var graphQLRequest = GraphQLRequestConsts.MetaFieldsRequest;

            AssertGraphQL.CorrectGraphQLRequest(graphQLRequest);
        }
コード例 #14
0
        public void AliasesRequestFact()
        {
            var graphQLRequest = GraphQLRequestConsts.AliasesRequest;

            AssertGraphQL.CorrectGraphQLRequest(graphQLRequest);
        }
コード例 #15
0
        public void FragmentsRequestFact()
        {
            var graphQLRequest = GraphQLRequestConsts.FragmentsRequest;

            AssertGraphQL.CorrectGraphQLRequest(graphQLRequest);
        }
コード例 #16
0
        public void FieldsRequest1Fact()
        {
            var graphQLRequest = GraphQLRequestConsts.FieldsRequest1;

            AssertGraphQL.CorrectGraphQLRequest(graphQLRequest);
        }
コード例 #17
0
        public void OperationNameRequestFact()
        {
            var graphQLRequest = GraphQLRequestConsts.OperationNameRequest;

            AssertGraphQL.CorrectGraphQLRequest(graphQLRequest);
        }
コード例 #18
0
        public void ArgumentsRequest2Fact()
        {
            var graphQLRequest = GraphQLRequestConsts.ArgumentsRequest2;

            AssertGraphQL.CorrectGraphQLRequest(graphQLRequest);
        }