public void CreateMutation_NestedInputObjectWith_CreatesCorrectQuery()
        {
            var networkClient = Substitute.For <INetworkClient>();
            var client        = new TestClient(networkClient);

            var mutation = client.CreateMutation(e => new
            {
                test = e.SomeOtherMutation(new SimpleObject()
                {
                    Object = new SimpleObject
                    {
                        Object = new SimpleObject
                        {
                            Test = 42
                        }
                    }
                })
            });

            AssertUtils.AreEqualIgnoreLineBreaks(@"mutation Mutation($var_0: SimpleObject) {
  field0: someMutation(input: $var_0)
  __typename
}", mutation.Query);

            Assert.AreEqual(42, ((SimpleObject)mutation.Variables["var_0"]).Object.Object.Test);
        }
        public void CreateMutation_InputObjectWithSimpleScalars_CreatesCorrectQuery()
        {
            var networkClient = Substitute.For <INetworkClient>();
            var client        = new TestClient(networkClient);

            var mutation = client.CreateMutation(e => new
            {
                test = e.SomeOtherMutation(new SimpleObject()
                {
                    Test      = 1,
                    TestArray = new int[] { 2, 3, 4 }
                })
            });

            AssertUtils.AreEqualIgnoreLineBreaks(@"mutation Mutation($var_0: SimpleObject) {
  field0: someMutation(input: $var_0)
  __typename
}", mutation.Query);

            Assert.AreEqual(1, ((SimpleObject)mutation.Variables["var_0"]).Test);
            Assert.AreEqual(new[] { 2, 3, 4 }, ((SimpleObject)mutation.Variables["var_0"]).TestArray);
        }