@@ -609,17 +609,15 @@ public void DynamicExpressionParser_ParseLambda_Config_StringLiteralEmpty_Return
609609 [ Fact ]
610610 public void DynamicExpressionParser_ParseLambda_StringLiteralEmbeddedQuote_ReturnsBooleanLambdaExpression ( )
611611 {
612- string expectedRightValue = "\" test \\ \" string\" " ;
613-
614612 // Act
615613 var expression = DynamicExpressionParser . ParseLambda (
616614 new [ ] { Expression . Parameter ( typeof ( string ) , "Property1" ) } ,
617615 typeof ( bool ) ,
618- string . Format ( "Property1 == {0}" , expectedRightValue ) ) ;
616+ string . Format ( "Property1 == {0}" , " \" test \\ \" string \" " ) ) ;
619617
620618 string rightValue = ( ( BinaryExpression ) expression . Body ) . Right . ToString ( ) ;
621619 Assert . Equal ( typeof ( bool ) , expression . Body . Type ) ;
622- Assert . Equal ( expectedRightValue , rightValue ) ;
620+ Assert . Equal ( " \" test \" string \" " , rightValue ) ;
623621 }
624622
625623 /// <summary>
@@ -659,17 +657,15 @@ public void DynamicExpressionParser_ParseLambda_MultipleLambdas()
659657 [ Fact ]
660658 public void DynamicExpressionParser_ParseLambda_StringLiteralStartEmbeddedQuote_ReturnsBooleanLambdaExpression ( )
661659 {
662- // Assign
663- string expectedRightValue = "\" \\ \" test\" " ;
664-
660+ // Act
665661 var expression = DynamicExpressionParser . ParseLambda (
666662 new [ ] { Expression . Parameter ( typeof ( string ) , "Property1" ) } ,
667663 typeof ( bool ) ,
668- string . Format ( "Property1 == {0}" , expectedRightValue ) ) ;
664+ string . Format ( "Property1 == {0}" , " \" \\ \" test \" " ) ) ;
669665
670666 string rightValue = ( ( BinaryExpression ) expression . Body ) . Right . ToString ( ) ;
671667 Assert . Equal ( typeof ( bool ) , expression . Body . Type ) ;
672- Assert . Equal ( expectedRightValue , rightValue ) ;
668+ Assert . Equal ( " \" \" test \" " , rightValue ) ;
673669 }
674670
675671 [ Fact ]
@@ -686,51 +682,51 @@ public void DynamicExpressionParser_ParseLambda_StringLiteral_MissingClosingQuot
686682 [ Fact ]
687683 public void DynamicExpressionParser_ParseLambda_StringLiteralEscapedBackslash_ReturnsBooleanLambdaExpression ( )
688684 {
689- // Assign
690- string expectedRightValue = "\" test\\ string\" " ;
691-
692685 // Act
693686 var expression = DynamicExpressionParser . ParseLambda (
694687 new [ ] { Expression . Parameter ( typeof ( string ) , "Property1" ) } ,
695688 typeof ( bool ) ,
696- string . Format ( "Property1 == {0}" , expectedRightValue ) ) ;
689+ string . Format ( "Property1 == {0}" , " \" test \\ \\ string \" " ) ) ;
697690
698691 string rightValue = ( ( BinaryExpression ) expression . Body ) . Right . ToString ( ) ;
699692 Assert . Equal ( typeof ( Boolean ) , expression . Body . Type ) ;
700- Assert . Equal ( expectedRightValue , rightValue ) ;
693+ Assert . Equal ( " \" test \\ string \" " , rightValue ) ;
701694 }
702695
703696 [ Fact ]
704697 public void DynamicExpressionParser_ParseLambda_StringLiteral_Backslash ( )
705698 {
706- string expectedLeftValue = "Property1.IndexOf( \" \\ \\ \" )" ;
699+ // Assign
707700 string expectedRightValue = "0" ;
701+
702+ //Act
708703 var expression = DynamicExpressionParser . ParseLambda (
709704 new [ ] { Expression . Parameter ( typeof ( string ) , "Property1" ) } ,
710705 typeof ( Boolean ) ,
711- string . Format ( "{0} >= {1}" , expectedLeftValue , expectedRightValue ) ) ;
706+ string . Format ( "{0} >= {1}" , "Property1.IndexOf( \" \\ \\ \" )" , expectedRightValue ) ) ;
712707
713708 string leftValue = ( ( BinaryExpression ) expression . Body ) . Left . ToString ( ) ;
714709 string rightValue = ( ( BinaryExpression ) expression . Body ) . Right . ToString ( ) ;
710+
711+ // Assert
715712 Assert . Equal ( typeof ( Boolean ) , expression . Body . Type ) ;
716- Assert . Equal ( expectedLeftValue , leftValue ) ;
713+ Assert . Equal ( "Property1.IndexOf( \" \\ \" )" , leftValue ) ;
717714 Assert . Equal ( expectedRightValue , rightValue ) ;
718715 }
719716
720717 [ Fact ]
721718 public void DynamicExpressionParser_ParseLambda_StringLiteral_QuotationMark ( )
722719 {
723- string expectedLeftValue = "Property1.IndexOf(\" \\ \" \" )" ;
724720 string expectedRightValue = "0" ;
725721 var expression = DynamicExpressionParser . ParseLambda (
726722 new [ ] { Expression . Parameter ( typeof ( string ) , "Property1" ) } ,
727723 typeof ( Boolean ) ,
728- string . Format ( "{0} >= {1}" , expectedLeftValue , expectedRightValue ) ) ;
724+ string . Format ( "{0} >= {1}" , "Property1.IndexOf( \" \\ \" \" )" , expectedRightValue ) ) ;
729725
730726 string leftValue = ( ( BinaryExpression ) expression . Body ) . Left . ToString ( ) ;
731727 string rightValue = ( ( BinaryExpression ) expression . Body ) . Right . ToString ( ) ;
732728 Assert . Equal ( typeof ( Boolean ) , expression . Body . Type ) ;
733- Assert . Equal ( expectedLeftValue , leftValue ) ;
729+ Assert . Equal ( "Property1.IndexOf( \" \" \" )" , leftValue ) ;
734730 Assert . Equal ( expectedRightValue , rightValue ) ;
735731 }
736732
0 commit comments