예제 #1
0
        public void IsDivisibleBy_NumbersTest()
        {
            var target = new Problem1();
            Assert.IsTrue(target.IsDivisibleBy(6, 2));
            Assert.IsTrue(target.IsDivisibleBy(100, 5));
            Assert.IsTrue(target.IsDivisibleBy(999, 3));
            Assert.IsTrue(target.IsDivisibleBy(19371, 1));
            Assert.IsTrue(target.IsDivisibleBy(7, 1));
            Assert.IsTrue(target.IsDivisibleBy(0, 15));

            Assert.IsFalse(target.IsDivisibleBy(7, 9));
            Assert.IsFalse(target.IsDivisibleBy(1, 9));
            Assert.IsFalse(target.IsDivisibleBy(10, 100));
        }
예제 #2
0
 public void IsDivisibleBy_ZeroAsDenominator()
 {
     var target = new Problem1();
     target.IsDivisibleBy(1, 0);
 }
예제 #3
0
 public void IsDivisibleBy_NegativeB()
 {
     var target = new Problem1();
     target.IsDivisibleBy(1, -3);
 }
예제 #4
0
 public void IsDivisibleBy_NegativeA()
 {
     var target = new Problem1();
     target.IsDivisibleBy(-1, 3);
 }