public void ReturnCorrectNumberOfComparisons() { List <MonthlyRepaymentComparison> comparisons = sut.CompareMonthlyRepayments(new LoanTerm(30)); // products has 3 items so this test should pass Assert.That(comparisons, Has.Exactly(3).Items); }
public void ReturnCorrectNumberOfComparisons() { List <MonthlyRepaymentComparison> comparisons = sut.CompareMonthlyRepayments(new LoanTerm(30)); Assert.That(comparisons, Has.Exactly(3).Items); }
public void ReturnCorrectNumberOfComparisons() { List <MonthlyRepaymentComparison> comparisons = sut.CompareMonthlyRepayments(new LoanTerm(30)); //Has constraint helper class has a number of convenience methods for working with collections Assert.That(comparisons, Has.Exactly(3).Items); }
public void ReturnCorrectNumberOfComparisons() { //Arrange //Code moved into Setup method // Act List <MonthlyRepaymentComparison> comparisons = _sut.CompareMonthlyRepayments(new LoanTerm(30)); //Assert Assert.That(comparisons, Has.Exactly(4).Items); }
public void ReturnCorrectnumberOfComparision() { List <MonthlyRepaymentComparison> comparisons = sut.CompareMonthlyRepayments(new LoanTerm(30)); Assert.That(comparisons, Has.Exactly(3).Items); Assert.That(comparisons, Is.Unique); var expectedProduct = new MonthlyRepaymentComparison("a", 1, 643.28m); //Test if expected product is there. Assert.That(comparisons, Does.Contain(expectedProduct)); }
public void ReturnCorrectNumberOfComparisons() { List <MonthlyRepaymentComparison> comparisons = sut.CompareMonthlyRepayments(new LoanTerm(30)); /** * The first kind of assert we can make against the collection is that they * contain the required number of items. Since we got 3 items in the products * list, then we expect 3 in the comparison output. * Now, we are going to use the Has helper class. This has convience helper * methods to help us quickly create constraint instances. */ Assert.That(comparisons, Has.Exactly(3).Items); }
public void ReturnCorrectNumberOfComparisons() { var comparisons = sut.CompareMonthlyRepayments(new LoanTerm(30)); //Assert.That(comparisons, Has.Exactly(3).Items); comparisons.Should().HaveCount(3); }