Example #1
0
        public void TestToString()
        {
            var query = new GraphQuery("user");

            query.Filters["id"] = "6";
            query.Fields        = new[]
            {
                new GraphQueryField("first_name"),
                new GraphQueryField("last_name"),
                new GraphQueryField("address")
                {
                    NestedFields = new []
                    {
                        new GraphQueryField("street"),
                        new GraphQueryField("city"),
                        new GraphQueryField("state"),
                        new GraphQueryField("zip"),
                    }
                },
            };

            var formatted = query.ToString();

            Assert.That(formatted, Is.EqualTo("user (id: 6) { first_name, last_name, address { street, city, state, zip } }"));
        }