File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Tests/UnitTestImpromptuInterface Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,30 @@ public void ExpandoPropertyTest()
111
111
}
112
112
113
113
114
+ [ Test ]
115
+ public void ExpandoSEtPropertyTest ( )
116
+ {
117
+
118
+ var prop1 = "Test" ;
119
+ var prop2 = 42L ;
120
+ var prop3 = Guid . NewGuid ( ) ;
121
+
122
+ dynamic tNew = new ExpandoObject ( ) ;
123
+
124
+
125
+ ISimpeleSetClassProps tActsLike = Impromptu . ActLike < ISimpeleSetClassProps > ( tNew ) ;
126
+ tActsLike . Prop1 = prop1 ;
127
+ tActsLike . Prop2 = prop2 ;
128
+ tActsLike . Prop3 = prop3 ;
129
+
130
+
131
+
132
+ Assert . AreEqual ( tNew . Prop1 , prop1 ) ;
133
+ Assert . AreEqual ( tNew . Prop2 , prop2 ) ;
134
+ Assert . AreEqual ( tNew . Prop3 , prop3 ) ;
135
+ }
136
+
137
+
114
138
[ Test ]
115
139
public void ImpromptuConversionPropertyTest ( )
116
140
{
Original file line number Diff line number Diff line change @@ -108,6 +108,16 @@ public interface ISimpeleClassProps
108
108
Guid Prop3 { get ; }
109
109
}
110
110
111
+ public interface ISimpeleSetClassProps
112
+ {
113
+ string Prop1 { set ; }
114
+
115
+ long Prop2 { set ; }
116
+
117
+ Guid Prop3 { set ; }
118
+ }
119
+
120
+
111
121
public interface IInheritProp : ISimpeleClassProps
112
122
{
113
123
PropPoco ReturnProp { get ; set ; }
You can’t perform that action at this time.
0 commit comments