コード例 #1
0
ファイル: ASTTest.cs プロジェクト: rolandzwaga/sharptiles
        public void Combined_Expression_Text_Tag_Attribute()
        {
            var attribute = new TagAttributeNode(new TextNode("Hello "), new ExpressionNode("(A+B)*C", "Multiply", typeof(decimal)).
                                                 Add(new ExpressionNode("(A Add B)", "Brackets", typeof(decimal)).Add(new ExpressionNode("A+B", "Add", typeof(decimal)).
                                                                                                                      Add(new ExpressionNode("A", "Property", null)).
                                                                                                                      Add(new ExpressionNode("B", "Property", null)))).
                                                 Add(new ExpressionNode("C", "Property", null)));

            Assert.That(attribute.Raw, Deeply.Is.EqualTo("Hello ${(A+B)*C}"));
        }
コード例 #2
0
ファイル: ASTTest.cs プロジェクト: rolandzwaga/sharptiles
        public void Single_Text_Tag_Attribute()
        {
            var attribute = new TagAttributeNode(new TextNode("Hello"));

            Assert.That(attribute.Raw, Deeply.Is.EqualTo("Hello"));
        }
コード例 #3
0
ファイル: ASTTest.cs プロジェクト: rolandzwaga/sharptiles
        public void Combined_Property_Text_Tag_Attribute()
        {
            var attribute = new TagAttributeNode(new TextNode("Hello "), new ExpressionNode("Person", "Property", null));

            Assert.That(attribute.Raw, Deeply.Is.EqualTo("Hello ${Person}"));
        }
コード例 #4
0
ファイル: ASTTest.cs プロジェクト: rolandzwaga/sharptiles
        public void Single_Property_Tag_Attribute()
        {
            var attribute = new TagAttributeNode(new ExpressionNode("Greetings", "Property", null));

            Assert.That(attribute.Raw, Deeply.Is.EqualTo("${Greetings}"));
        }