public void BigIntExplicit() { BigInteger val = 42; var i = new PyInt(val); var ni = i.As <BigInteger>(); Assert.AreEqual(val, ni); var nullable = i.As <BigInteger?>(); Assert.AreEqual(val, nullable); }
public void PyIntImplicit() { var i = new PyInt(1); var ni = (PyObject)i.As <object>(); Assert.IsTrue(PythonReferenceComparer.Instance.Equals(i, ni)); }
public void PyIntImplicit() { var i = new PyInt(1); var ni = (PyObject)i.As <object>(); Assert.AreEqual(i.rawPtr, ni.rawPtr); }
public void ToNullable() { const int Const = 42; var i = new PyInt(Const); var ni = i.As <int?>(); Assert.AreEqual(Const, ni); }