Beispiel #1
0
        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);
        }
Beispiel #2
0
        public void PyIntImplicit()
        {
            var i  = new PyInt(1);
            var ni = (PyObject)i.As <object>();

            Assert.IsTrue(PythonReferenceComparer.Instance.Equals(i, ni));
        }
Beispiel #3
0
        public void PyIntImplicit()
        {
            var i  = new PyInt(1);
            var ni = (PyObject)i.As <object>();

            Assert.AreEqual(i.rawPtr, ni.rawPtr);
        }
Beispiel #4
0
        public void ToNullable()
        {
            const int Const = 42;
            var       i     = new PyInt(Const);
            var       ni    = i.As <int?>();

            Assert.AreEqual(Const, ni);
        }