Beispiel #1
0
        public void ItalyCalculateTotalTaxDeductions_GivenSalary_Returns_TotalTaxDeductionsValue()
        {
            // Arrange
            var calculator = new ItalyPayrollCalculator();

            //Act
            var actual = calculator.CalculateTotalTaxDeductions(600);

            // Assert
            var expected = 265.14; // TODO:

            actual.Should().Be(expected);
        }
Beispiel #2
0
        public void ItalyCalculateIncomeTax_GivenSalaryLessThanZero_Returns_InvalidInputException()
        {
            // Arrange
            var italySaleryCalculator = new ItalyPayrollCalculator();

            //Act
            Action calculateIncomeTax          = () => italySaleryCalculator.CalculateIncomeTax(-200);
            Action calculateTotalTaxDeductions = () => italySaleryCalculator.CalculateTotalTaxDeductions(-200);

            // Assert
            string expectedMessage = "Given salary should be greater than zero, received value:";

            calculateIncomeTax.Should().Throw <InvalidInputException>().Where(e => e.Message.StartsWith(expectedMessage));
            calculateTotalTaxDeductions.Should().Throw <InvalidInputException>().Where(e => e.Message.StartsWith(expectedMessage));
        }