﻿using Xunit;
using MortgageCalc.Calculators;

namespace MortgageCalc.tests
{
    public class InterestScheduleTest
    {
        [Theory(DisplayName = "Test the Totals Are set right")]
        [InlineData(400000, 8.75, 24)]
        public void TestTotals(decimal principal, decimal rate, int term)
        {
            var builder = new InterestOnlyScheduleBuilder(principal, rate, term);
            var actual = builder.Schedule();

            Assert.Equal(2916.67m, actual.MonthlyPayment);
            Assert.Equal(70000, actual.CostOfCredit);
        }
    }
}
