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

            // act
            var success = type.TryDeserialize(null, out object?selectionSet);

            // assert
            Assert.True(success);
            Assert.Null(selectionSet);
        }
Exemple #2
0
        public void TryDeserialize_Invalid_Type()
        {
            // arrange
            var       type       = new FieldSetType();
            const int serialized = 1;

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

            // assert
            Assert.False(success);
            Assert.Null(selectionSet);
        }
Exemple #3
0
        public void TryDeserialize()
        {
            // arrange
            var          type       = new FieldSetType();
            const string serialized = "a b c d e(d: $b)";

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

            // assert
            Assert.True(success);
            Assert.IsType <SelectionSetNode>(selectionSet);
        }