Beispiel #1
0
        public void Create_StringValueNode_1()
        {
            // arrange
            // act
            var value = new StringValueNode("abc");

            // assert
            Assert.Equal("abc", value.Value);
            Assert.False(value.Block);
            Assert.Equal(SyntaxKind.StringValue, value.Kind);
            Assert.Null(value.Location);
            Assert.Empty(value.GetNodes());
        }
Beispiel #2
0
        public void Create_StringValueNode_3_Location_Is_Null()
        {
            // arrange
            var stringValue = Encoding.UTF8.GetBytes("abc");

            // act
            var value = new StringValueNode(null, stringValue, true);

            // assert
            Assert.Equal("abc", value.Value);
            Assert.True(value.Block);
            Assert.Equal(SyntaxKind.StringValue, value.Kind);
            Assert.Null(value.Location);
            Assert.Empty(value.GetNodes());
        }
Beispiel #3
0
        public void Create_StringValueNode_2_With_Location()
        {
            // arrange
            var location = new Location(1, 1, 1, 1);

            // act
            var value = new StringValueNode(location, "abc", true);

            // assert
            Assert.Equal("abc", value.Value);
            Assert.True(value.Block);
            Assert.Equal(SyntaxKind.StringValue, value.Kind);
            Assert.Same(location, value.Location);
            Assert.Empty(value.GetNodes());
        }
Beispiel #4
0
        public void WithLocation()
        {
            // arrange
            var location = new Location(1, 1, 1, 1);
            var value    = new StringValueNode("abc");

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


            // assert
            Assert.Equal("abc", value.Value);
            Assert.False(value.Block);
            Assert.Equal(SyntaxKind.StringValue, value.Kind);
            Assert.Same(location, value.Location);
            Assert.Empty(value.GetNodes());
        }
Beispiel #5
0
        public void WithValue_2()
        {
            // arrange
            var value = new StringValueNode("abc");

            Assert.False(value.Block);

            // act
            value = value.WithValue("def", true);


            // assert
            Assert.Equal("def", value.Value);
            Assert.True(value.Block);
            Assert.Equal(SyntaxKind.StringValue, value.Kind);
            Assert.Null(value.Location);
            Assert.Empty(value.GetNodes());
        }