Exemplo n.º 1
0
        public void RoundBank_WithAnIntegerAmmount_ReturnsSameNumber()
        {
            IBankCalculus sut            = new BankCalculus();
            decimal       integerAmmount = 9;

            decimal result = sut.RoundBank(integerAmmount);

            Assert.AreEqual(integerAmmount, result);
        }
Exemplo n.º 2
0
        public void RoundBank_WithThreeDecimalsEqualTo005_ReturnsARoundedNumberToUp()
        {
            IBankCalculus sut           = new BankCalculus();
            decimal       threeDecimals = 1.005M;
            decimal       expected      = 1.01M;

            decimal result = sut.RoundBank(threeDecimals);

            Assert.AreEqual(expected, result);
        }
Exemplo n.º 3
0
        public void RoundBank_WithThreeDecimals_ReturnsARoundedNumber()
        {
            IBankCalculus sut           = new BankCalculus();
            decimal       threeDecimals = 1.001M;

            decimal result = sut.RoundBank(threeDecimals);

            Assert.AreNotEqual(threeDecimals, result);
            Assert.IsTrue(result.ToString().Length == threeDecimals.ToString().Length - 1);
        }