Example #1
0
        public void FieldError_CreateWithoutLocation()
        {
            // arrange
            var fieldSelection = new FieldNode(
                null,
                new NameNode("foo"),
                null,
                new List <DirectiveNode>(),
                new List <ArgumentNode>(),
                null);

            // act
            var error = new FieldError("a", fieldSelection);

            // assert
            Assert.Equal("a", error.Message);
            Assert.Equal("foo", error.Extensions["fieldName"]);
            Assert.Null(error.Locations);
        }
Example #2
0
        public void FieldError_CreateWithoutLocation()
        {
            // arrange
            var fieldSelection = new FieldNode(
                null,
                new NameNode("foo"),
                null,
                new List <DirectiveNode>(),
                new List <ArgumentNode>(),
                null);

            // act
#pragma warning disable CS0618 // Type or member is obsolete
            var error = new FieldError("a", fieldSelection);
#pragma warning restore CS0618 // Type or member is obsolete

            // assert
            Assert.Equal("a", error.Message);
            Assert.Equal("foo", error.Extensions["fieldName"]);
            Assert.Null(error.Locations);
        }