Skip to content

Commit 15ec052

Browse files
author
Vyacheslav
committed
feat:
Helper tests: + Test GetOutPropertyValue #14
1 parent bb14f31 commit 15ec052

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Src/Tests/HelperFixture.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,5 +246,39 @@ public void GetPropertyValueTest()
246246
wrap2.Dispose();
247247
}
248248
}
249+
250+
[Test]
251+
public void GetOutPropertyValueTest()
252+
{
253+
unsafe
254+
{
255+
var wrap2 = new Struct.HelpStructWrapper();
256+
var helpStructRef = new HelpStruct()
257+
{
258+
Int32 = 45,
259+
Int64 = 4564564564,
260+
HelpClass = new HelpClass()
261+
{
262+
Int32 = 12,
263+
Int64 = 321123,
264+
HelpStruct2 = new HelpStruct2(321, 98746512),
265+
HelpClass2 = new HelpClass()
266+
}
267+
};
268+
wrap2.Fill(in helpStructRef);
269+
wrap2.HelpClass2 = new IntPtr(4823);
270+
271+
HelpStructHelper.GetOutInt64Value(wrap2.Ptr, out var int64Value);
272+
Assert.That(int64Value, Is.EqualTo(4564564564));
273+
274+
HelpStructHelper.GetOutInt32Value(wrap2.Ptr, out var int32Value);
275+
Assert.That(int32Value, Is.EqualTo(45));
276+
277+
HelpStructHelper.GetOutHelpClass2Value(wrap2.Ptr, out var helpClass2Value);
278+
Assert.That(helpClass2Value, Is.EqualTo(new IntPtr(4823)));
279+
280+
wrap2.Dispose();
281+
}
282+
}
249283
}
250284
}

0 commit comments

Comments
 (0)