File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
tests/Moq.Tests/Regressions Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -3688,6 +3688,35 @@ public virtual void SecondCall()
3688
3688
3689
3689
#endregion
3690
3690
3691
+ #region 1217
3692
+
3693
+ public class Issue1217
3694
+ {
3695
+ [ Fact ]
3696
+ public void It_Is_predicates_are_evaluated_lazily ( )
3697
+ {
3698
+ var patternKey = "" ;
3699
+ var exeKey = "" ;
3700
+
3701
+ var mock = new Mock < ISettingsService > ( ) ;
3702
+ mock . Setup ( x => x . GetSetting ( It . Is < string > ( y => y == patternKey ) ) ) . Returns ( ( ) => patternKey ) ;
3703
+ mock . Setup ( x => x . GetSetting ( It . Is < string > ( y => y == exeKey ) ) ) . Returns ( ( ) => exeKey ) ;
3704
+
3705
+ patternKey = "foo" ;
3706
+ exeKey = "bar" ;
3707
+
3708
+ Assert . Equal ( "foo" , mock . Object . GetSetting ( patternKey ) ) ;
3709
+ Assert . Equal ( "bar" , mock . Object . GetSetting ( exeKey ) ) ;
3710
+ }
3711
+
3712
+ public interface ISettingsService
3713
+ {
3714
+ string GetSetting ( string key ) ;
3715
+ }
3716
+ }
3717
+
3718
+ #endregion
3719
+
3691
3720
#region 1225
3692
3721
3693
3722
public class Issue1225
You can’t perform that action at this time.
0 commit comments