File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
tests/Moq.Tests/Regressions Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -3549,6 +3549,36 @@ public interface IMockObject
35493549
35503550 #endregion
35513551
3552+ #region 1066
3553+
3554+ public class Issue1066
3555+ {
3556+ public interface IX
3557+ {
3558+ int Property { get ; set ; }
3559+ }
3560+
3561+ [ Fact ]
3562+ public void Stubbed_property_set_before_SetupGet ( )
3563+ {
3564+ var mock = Mock . Get ( Mock . Of < IX > ( ) ) ;
3565+ mock . Object . Property = 4 ;
3566+ mock . SetupGet ( m => m . Property ) . Returns ( 3 ) ;
3567+ Assert . Equal ( 3 , mock . Object . Property ) ;
3568+ }
3569+
3570+ [ Fact ]
3571+ public void Stubbed_property_set_after_SetupGet ( )
3572+ {
3573+ var mock = Mock . Get ( Mock . Of < IX > ( ) ) ;
3574+ mock . SetupGet ( m => m . Property ) . Returns ( 3 ) ;
3575+ mock . Object . Property = 4 ;
3576+ Assert . Equal ( 3 , mock . Object . Property ) ;
3577+ }
3578+ }
3579+
3580+ #endregion
3581+
35523582 #region 1071
35533583
35543584 public class Issue1071
You can’t perform that action at this time.
0 commit comments