Exemplo n.º 1
0
        public void WithDescription()
        {
            // arrange
            var source = new Source("foo");
            var start  = new SyntaxToken(
                TokenKind.StartOfFile, 0, 0, 1, 1, null);
            var location    = new Location(source, start, start);
            var name        = new NameNode("foo");
            var description = new StringValueNode("bar");
            var directives  = new List <DirectiveNode>();
            var values      = new List <EnumValueDefinitionNode>();

            var type = new EnumTypeDefinitionNode(
                location,
                name,
                description,
                directives,
                values);

            // act
            type = type.WithDescription(new StringValueNode("baz"));


            // assert
            Assert.Equal("baz", type.Description.Value);
        }
        public void WithDescription()
        {
            // arrange
            var location    = new Location(0, 0, 0, 0);
            var name        = new NameNode("foo");
            var description = new StringValueNode("bar");
            var directives  = new List <DirectiveNode>();
            var values      = new List <EnumValueDefinitionNode>();

            var type = new EnumTypeDefinitionNode(
                location,
                name,
                description,
                directives,
                values);

            // act
            type = type.WithDescription(new StringValueNode("baz"));


            // assert
            Assert.Equal("baz", type.Description.Value);
        }