예제 #1
0
        public void WithLocation()
        {
            // 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(
                null,
                name,
                description,
                directives,
                values);

            // act
            type = type.WithLocation(location);


            // assert
            Assert.Equal(location, type.Location);
        }
        public void WithLocation()
        {
            // 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(
                null,
                name,
                description,
                directives,
                values);

            // act
            type = type.WithLocation(location);


            // assert
            Assert.Equal(location, type.Location);
        }