Skip to content

Commit bd94e49

Browse files
committed
Add PrimitiveIntConversion test
1 parent f59335f commit bd94e49

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/embed_tests/TestConverter.cs

+12
Original file line numberDiff line numberDiff line change
@@ -186,5 +186,17 @@ public void RawPyObjectProxy()
186186
var proxiedHandle = pyObjectProxy.GetAttr("Handle").As<IntPtr>();
187187
Assert.AreEqual(pyObject.Handle, proxiedHandle);
188188
}
189+
190+
[Test]
191+
public void PrimitiveIntConversion()
192+
{
193+
decimal value = 10;
194+
var pyValue = value.ToPython();
195+
196+
// Try to convert python value to int
197+
var testInt = pyValue.As<int>();
198+
Assert.AreEqual(testInt , 10);
199+
}
200+
189201
}
190202
}

0 commit comments

Comments
 (0)