示例#1
0
        public void Can_Insert()
        {
            var a = BitAlgorithms.InsertNumber(15, 15, 0, 0);
            var b = BitAlgorithms.InsertNumber(15, 8, 0, 0);
            var c = BitAlgorithms.InsertNumber(15, 8, 3, 8);

            Assert.AreEqual(15, a);
            Assert.AreEqual(9, b);
            Assert.AreEqual(120, c);
        }
 public void Insert_Throws_If_Negative(int source, int drain, int start, int end)
 => Assert.Throws <ArgumentOutOfRangeException>(
     () => BitAlgorithms.InsertNumber(source, drain, start, end));
 public void Insert_Throws_If_EndNotInRange() => Assert.Throws <ArgumentOutOfRangeException>(
     () => BitAlgorithms.InsertNumber(8, 15, 1, 35));
 public void Insert_Throws_If_EndLessThanStart() => Assert.Throws <ArgumentOutOfRangeException>(
     () => BitAlgorithms.InsertNumber(8, 15, 10, 9));
 public int Can_Insert(int source, int drain, int start, int end) => BitAlgorithms.InsertNumber(source, drain, start, end);