예제 #1
0
        public void CalcualteTotalTransaction_AmountAndFeeProvided_ReturnsAmountMinusFee()
        {
            const int baseAmount = 100;
            const int fee = 5;
            var feeTransaction = new FeeTransaction(baseAmount, fee);

            var totalTransaction = feeTransaction.CalculateTotalTransaction();

            const int expectedTotalTransaction = baseAmount - fee;
            Assert.That(totalTransaction, Is.EqualTo(expectedTotalTransaction),
                "Calculated transaction should equal the base amount minus the fee.");
        }
예제 #2
0
        public void CalculateTotalTransaction_AmountAndFeeProvided_ReturnsAmountMinusFee()
        {
            const int baseAmount     = 100;
            const int fee            = 5;
            var       feeTransaction = new FeeTransaction(baseAmount, fee);

            var totalTransaction = feeTransaction.CalculateTotalTransaction();

            const int expectedTotalTransaction = baseAmount - fee;

            Assert.That(totalTransaction, Is.EqualTo(expectedTotalTransaction), "Calculated transaction should equal the base amount minus the fee.");
        }
예제 #3
0
        public void CalculateTotalTransaction_AmountAndFeeProvided_ReturnsAmountMinusFee()
        {
            //Arrange
            const int baseAmount = 100;
            const int fee        = 5;
            var       sut        = new FeeTransaction(baseAmount, fee);

            //Act
            var totalTransaction = sut.CalculateTotalTransaction();

            //Assert
            const int expectedTotalTransaction = baseAmount - fee;

            //Uncomment to show beacause message parameter
            //const int expectedTotalTransaction = baseAmount - fee - 1;
            totalTransaction.Should().Be(expectedTotalTransaction,
                                         because: "calculated transaction should be equal to the base amount minus the fee");
        }