public void Divide_WhenCalledWithExample1_ReturnsGivenResult()
        {
            // Arrange
            int dividend = 10;
            int divisor  = 3;
            int expected = 3;

            // Act
            var result = _sut.Divide(dividend, divisor);

            // Assert
            Assert.AreEqual(expected, result);
        }
        public void Divide(int dividend, int divisor, int expected)
        {
            var sut    = new DivideTwoIntegers();
            var actual = sut.Divide(dividend, divisor);

            Assert.AreEqual(expected, actual);
        }
 public void Given_101_When_divide_0_Then_int_max()
 {
     Assert.AreEqual(int.MaxValue, DivideTwoIntegers.Divide(101, 0));
 }
 public void Given_1100540749_When_divide_n1090366779_Then_n1()
 {
     Assert.AreEqual(-1, DivideTwoIntegers.Divide(1100540749, -1090366779));
 }
 public void Given_2147483647_When_divide_2_Then_1073741823()
 {
     Assert.AreEqual(1073741823, DivideTwoIntegers.Divide(2147483647, 2));
 }
 public void Given_10_When_divide_10_Then_1()
 {
     Assert.AreEqual(1, DivideTwoIntegers.Divide(10, 10));
 }
 public void Given_20_When_divide_3_Then_6()
 {
     Assert.AreEqual(6, DivideTwoIntegers.Divide(20, 3));
 }
 public void Given_20_When_divide_5_Then_4()
 {
     Assert.AreEqual(4, DivideTwoIntegers.Divide(20, 5));
 }
 public void Given_n101_When_divide_min_than_101_Then_zero()
 {
     Assert.AreEqual(0, DivideTwoIntegers.Divide(-101, -202));
 }
 public void Given_int_min_When_divide_negative_1_Then_int_max()
 {
     Assert.AreEqual(int.MaxValue, DivideTwoIntegers.Divide(int.MinValue, -1));
 }
Beispiel #11
0
        public void PositiveAnswer(int dividend, int divisor, int expected)
        {
            var actual = _kata.Divide(dividend, divisor);

            Assert.AreEqual(expected, actual);
        }
        public void Test1()
        {
            var result = solution.Divide(-2147483648, -1);

            Assert.AreEqual(2147483647, result);
        }