public async Task CalculateMontlyRateAsync_ParametersOk_Calculate(decimal mortgageLoan,
                                                                          double annualInterest, uint numberOfPayments, decimal rate)
        {
            var logFactoryMock = new Mock <ILoggerFactory>();
            var logMock        = new Mock <ILogger>();

            logFactoryMock
            .Setup(e => e.CreateLogger(nameof(MortgageCalculator)))
            .Returns(logMock.Object);

            var target = new MortgageCalculator(logFactoryMock.Object);

            var actual = await target.CalculateMontlyRateAsync(mortgageLoan, annualInterest, numberOfPayments);

            Assert.True(actual.Succeed);
            Assert.Null(actual.Error);
            Assert.Equal(actual.Result.Value, rate);
        }
        public async Task CalculateMontlyRateAsync_AnnualInterestLessThanZero_Error()
        {
            decimal mortgageLoan     = 100000;
            double  annualInterest   = -10;
            uint    numberOfPayments = 10;

            var logFactoryMock = new Mock <ILoggerFactory>();
            var logMock        = new Mock <ILogger>();

            logFactoryMock
            .Setup(e => e.CreateLogger(nameof(MortgageCalculator)))
            .Returns(logMock.Object);

            var target = new MortgageCalculator(logFactoryMock.Object);

            var actual = await target.CalculateMontlyRateAsync(mortgageLoan, annualInterest, numberOfPayments);

            Assert.False(actual.Succeed);
            Assert.NotNull(actual.Error);
            Assert.Equal(actual.Error.Code, MortgageCalculatorErrors.AnnualInterestNotValid);
        }