Example #1
0
        public void Serialize_Invalid_Format()
        {
            // arrange
            var type = new FieldSetType();

            // act
            void Action() => type.Serialize(1);

            // assert
            Assert.Throws <SerializationException>(Action);
        }
Example #2
0
        public void Serialize()
        {
            // arrange
            var type = new FieldSetType();
            SelectionSetNode selectionSet =
                Utf8GraphQLParser.Syntax.ParseSelectionSet("{ a b c d e(d: $b) }");

            // act
            object?serialized = type.Serialize(selectionSet);

            // assert
            Assert.Equal("a b c d e(d: $b)", serialized);
        }