Пример #1
0
        public void NumberSwapXorLesserGreaterNegative()
        {
            int a = -10;
            int b = 8;

            NumberSwap.NumberSwapXor(ref a, ref b);
            Assert.AreEqual(a, 8);
            Assert.AreEqual(b, -10);
        }
Пример #2
0
        public void NumberSwapXorGreaterLesser()
        {
            int a = 9;
            int b = 2;

            NumberSwap.NumberSwapXor(ref a, ref b);
            Assert.AreEqual(a, 2);
            Assert.AreEqual(b, 9);
        }
Пример #3
0
        public void NumberSwapXorEqual()
        {
            int a = 3;
            int b = 3;

            NumberSwap.NumberSwapXor(ref a, ref b);
            Assert.AreEqual(a, 3);
            Assert.AreEqual(b, 3);
        }
Пример #4
0
        public void NumberSwapXorLesserGreater()
        {
            int a = 3;
            int b = 8;

            NumberSwap.NumberSwapXor(ref a, ref b);
            Assert.AreEqual(a, 8);
            Assert.AreEqual(b, 3);
        }
Пример #5
0
        public void NumberSwapXorGreaterLesserNegative()
        {
            int a = -9;
            int b = -11;

            NumberSwap.NumberSwapXor(ref a, ref b);
            Assert.AreEqual(a, -11);
            Assert.AreEqual(b, -9);
        }