public static void ShouldBeCreateUriExpressionFor(this TestAttributeNode attribute, string originalValue)
 {
     attribute.CodeExpressionNodes.ShouldHaveCount(1);
     string createUriExpression = StubSyntaxProvider.GetTestCreateUriExpression(originalValue);
     string nullCheckExpression = StubSyntaxProvider.GetTestNullCheckExpression(originalValue);
     ConditionalExpression expectedExpression = new ConditionalExpression(nullCheckExpression, createUriExpression);
     attribute.CodeExpressionNodes.First().As<TestConditionalExpressionNode>().ConditionalExpression.ShouldEqual(expectedExpression);
 }
 private void ThenOptionChildElementShouldHaveConditionalSelectAttributeFor(string resourceValueExpr)
 {
     var expected = new ConditionalExpression(StubSyntaxProvider.GetTestNulLCheckAndEvalFor(resourceValueExpr),
                                              resourceValueExpr);
     IAttribute attribute = Context.ElementTarget.Elements.Cast<TestElement>().First().GetAttribute("selected");
     attribute.ShouldBe<TestAttributeNode>();
     attribute.As<TestAttributeNode>().ConditionalExpressionNodes.First().ConditionalExpression.ShouldEqual(expected);
 }
 public void SetExpressionBody(ConditionalExpression conditionalExpression)
 {
     _conditionalExpression = conditionalExpression;
 }
 private void ThenNewAttributeShouldHaveConditionalNodeWithNullCheckFor(string value)
 {
     ConditionalExpression expected = new ConditionalExpression(StubSyntaxProvider.GetTestNulLCheckAndEvalFor(value), value);
     Context.NewAttribute.As<TestAttributeNode>().ConditionalExpressionNodes.Single().As<TestConditionalExpressionNode>().ConditionalExpression.ShouldEqual(expected);
 }