コード例 #1
0
    public void Serialize_Invalid_Format()
    {
        // arrange
        var type = new FieldSetType();

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

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

        // act
        var serialized = type.Serialize(selectionSet);

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