Ejemplo n.º 1
0
        public void ShouldAddInnerTextWithResourceExpression()
        {
            TestElement element = InternalTestNodes.TestElement("foo").WithAttribute("for", "resource.Stuff");

            element.AddTextElement("this is the inner text");
            GivenElementTarget(element);
            WhenActionCalledOnElement();
            ThenThenElementShouldContainConditional("resource.Stuff", StubSyntaxProvider.GetTestNullCheckExpression("resource"));
        }
        public static void ShouldBeCreateUriExpressionFor(this TestAttributeNode attribute, string originalValue)
        {
            attribute.ConditionalExpressionNodes.ShouldHaveCount(1);
            string createUriExpression = StubSyntaxProvider.GetTestCreateUriExpression(originalValue);
            string nullCheckExpression = StubSyntaxProvider.GetTestNullCheckExpression(originalValue);
            ConditionalExpression expectedExpression = new ConditionalExpression(nullCheckExpression, createUriExpression);

            attribute.ConditionalExpressionNodes.First().As <TestConditionalExpressionNode>().ConditionalExpression.ShouldEqual(expectedExpression);
        }