public void Equals() { var cardA = CreditCard.BarclayCard(); var cardB = CreditCard.BarclayCard(); var cardC = CreditCard.Vanquis(); Assert.IsTrue(cardA == cardB); Assert.IsFalse(cardB == cardC); }
public void Distinct() { List <CreditCard> list = new List <CreditCard> { CreditCard.BarclayCard(), CreditCard.BarclayCard(), CreditCard.Vanquis() }; Assert.AreEqual(2, list.Distinct().Count()); }
/// <summary> /// Determines what credit product is suitable for the applicant. /// </summary> /// <returns> new instance of applicant with their assigned credit product. </returns> public Applicant ApproveApplication() { if (Age > 18 && AnnualIncome > 30000) { return(new Applicant(this.Id, this.FirstName, this.LastName, this.DateOfBirth, this.AnnualIncome, CreditCard.BarclayCard())); } if (Age > 18) { return(new Applicant(this.Id, this.FirstName, this.LastName, this.DateOfBirth, this.AnnualIncome, CreditCard.Vanquis())); } return(this); }