Exemple #1
0
    public void ElementToInputs(IGraphQLTextSerializer serializer)
    {
        var test   = $"{{\"query\":\"hello\",\"variables\":{ExampleJson}}}";
        var actual = serializer.Deserialize <TestClass2>(test);

        actual.Query.ShouldBe("hello");
        var variables = serializer.ReadNode <Inputs>(actual.Variables);

        Verify(variables);
    }
    public void Reads_OperationMessage_Populated(IGraphQLTextSerializer serializer)
    {
        var test   = $"{{\"id\":\"hello\",\"type\":\"hello2\",\"payload\":{{\"query\":\"hello3\",\"variables\":{ExampleJson}}}}}";
        var actual = serializer.Deserialize <OperationMessage>(test);

        actual.Id.ShouldBe("hello");
        actual.Type.ShouldBe("hello2");
        actual.Payload.ShouldNotBeNull();
        var request = serializer.ReadNode <GraphQLRequest>(actual.Payload);

        request.Query.ShouldBe("hello3");
        Verify(request.Variables);
    }