// Example
            // <input checked="hello-world `@false`"/>
            //  Prefix= (space)
            //  Children will contain a token for @false.
            public override void VisitDynamicAttributeBlock(DynamicAttributeBlockChunkGenerator chunkGenerator, Block block)
            {
                var firstChild = block.Children.FirstOrDefault(c => c.IsBlock) as Block;

                if (firstChild == null || firstChild.Type == BlockKindInternal.Expression)
                {
                    _builder.Push(new CSharpExpressionAttributeValueIntermediateNode()
                    {
                        Prefix = chunkGenerator.Prefix,
                        Source = BuildSourceSpanFromNode(block),
                    });
                }
                else
                {
                    _builder.Push(new CSharpCodeAttributeValueIntermediateNode()
                    {
                        Prefix = chunkGenerator.Prefix,
                        Source = BuildSourceSpanFromNode(block),
                    });
                }

                VisitDefault(block);

                _builder.Pop();
            }
Ejemplo n.º 2
0
        public void GetHashCode_ReturnsSameValue_WhenEqual(
            DynamicAttributeBlockChunkGenerator leftObject,
            DynamicAttributeBlockChunkGenerator rightObject)
        {
            // Arrange & Act
            var leftResult = leftObject.GetHashCode();
            var rightResult = rightObject.GetHashCode();

            // Assert
            Assert.Equal(leftResult, rightResult);
        }
Ejemplo n.º 3
0
 public virtual void VisitDynamicAttributeBlock(DynamicAttributeBlockChunkGenerator chunkGenerator, Block block)
 {
     VisitDefault(block);
 }
Ejemplo n.º 4
0
        public void Equals_True_WhenExpected(
            DynamicAttributeBlockChunkGenerator leftObject,
            DynamicAttributeBlockChunkGenerator rightObject)
        {
            // Arrange & Act
            var result = leftObject.Equals(rightObject);

            // Assert
            Assert.True(result);
        }