Skip to content

Commit 7f382b1

Browse files
committed
Added set only prooperty test. Tests Passed.
Verifying Get/Set Refactor by @quetzalcoatl
1 parent d67654f commit 7f382b1

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

Tests/UnitTestImpromptuInterface/Basic.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,30 @@ public void ExpandoPropertyTest()
111111
}
112112

113113

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+
114138
[Test]
115139
public void ImpromptuConversionPropertyTest()
116140
{

Tests/UnitTestImpromptuInterface/Support/SupportDefinitions.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ public interface ISimpeleClassProps
108108
Guid Prop3 { get; }
109109
}
110110

111+
public interface ISimpeleSetClassProps
112+
{
113+
string Prop1 { set ; }
114+
115+
long Prop2 { set; }
116+
117+
Guid Prop3 { set; }
118+
}
119+
120+
111121
public interface IInheritProp:ISimpeleClassProps
112122
{
113123
PropPoco ReturnProp { get; set; }

0 commit comments

Comments
 (0)