Beispiel #1
0
        public static void TestAssigmentWithOverloadPlusOperator()
        {
            IntWrapper @int = new IntWrapper(3);

            @int += @int += new IntWrapper(1);
            Assert.AreEqual(7, @int.ToInt());
        }
Beispiel #2
0
        public void TestOverloadUnaryOperator()
        {
            IntWrapper @int = new IntWrapper(3);

            @int++;
            Assert.AreEqual(4, @int.ToInt(), "4");
            Assert.AreEqual(5, (++@int).ToInt(), "++4");
            Assert.AreEqual(5, (@int++).ToInt(), "5++");
            Assert.AreEqual(6, (@int).ToInt(), "6");
        }