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

            // act
            var success = type.TrySerialize(1, out object?serialized);

            // assert
            Assert.False(success);
            Assert.Null(serialized);
        }
Beispiel #2
0
        public void TrySerialize()
        {
            // arrange
            var type = new FieldSetType();
            SelectionSetNode selectionSet =
                Utf8GraphQLParser.Syntax.ParseSelectionSet("{ a b c d e(d: $b) }");

            // act
            var success = type.TrySerialize(selectionSet, out object?serialized);

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