Exemplo n.º 1
0
        public void MainTest()
        {
            int result   = BitSwapper.InsertNumber(5, 3, 0, 2);
            int expected = 7;

            Assert.AreEqual(expected, result);

            result   = BitSwapper.InsertNumber(5, 2, 0, 0);
            expected = 4;
            Assert.AreEqual(expected, result);
        }
        public void MainTest()
        {
            int result   = BitSwapper.InsertNumber(15, 15, 0, 0);
            int expected = 15;

            Assert.AreEqual(expected, result);

            result   = BitSwapper.InsertNumber(8, 15, 0, 0);
            expected = 9;
            Assert.AreEqual(expected, result);

            result   = BitSwapper.InsertNumber(8, 15, 3, 8);
            expected = 120;
            Assert.AreEqual(expected, result);
        }
Exemplo n.º 3
0
 public void ArgumentTest()
 {
     BitSwapper.InsertNumber(0, 0, 2, 33);
 }
 public void ArgumentTest()
 {
     Assert.Throws(typeof(ArgumentException), () => BitSwapper.InsertNumber(0, 0, 3, 1));
 }