public void TestConvertToInt32()
        {
            var a = new PyLong(5);

            Assert.IsInstanceOf(typeof(int), a.ToInt32());
            Assert.AreEqual(5, a.ToInt32());
        }
        public void TestCtorSByte()
        {
            const sbyte i = 5;
            var         a = new PyLong(i);

            Assert.AreEqual(i, a.ToInt32());
        }
        public void TestCtorUShort()
        {
            const ushort i = 5;
            var          a = new PyLong(i);

            Assert.AreEqual(i, a.ToInt32());
        }
        public void TestCtorULong()
        {
            const ulong i = 5;
            var         a = new PyLong(i);

            Assert.AreEqual(i, a.ToInt32());
        }
        public void TestCtorString()
        {
            const string i = "5";
            var          a = new PyLong(i);

            Assert.AreEqual(5, a.ToInt32());
        }
        public void TestCtorDouble()
        {
            double i = 5.0;
            var    a = new PyLong(i);

            Assert.AreEqual(i, a.ToInt32());
        }
示例#7
0
        public void TestCtorPyObject()
        {
            var i = new PyLong(5);
            var a = new PyLong(i);

            Assert.AreEqual(5, a.ToInt32());
        }
示例#8
0
        public void TestCtorPtr()
        {
            var i = new PyLong(5);
            var a = new PyLong(i.Handle);

            Assert.AreEqual(5, a.ToInt32());
        }
示例#9
0
 public void TestCtorPyObject()
 {
     var i = new PyLong(5);
     Runtime.Runtime.XIncref(i.Handle);
     var a = new PyLong(i);
     Assert.AreEqual(5, a.ToInt32());
 }