public void TestFindCard() { //Arrange int code = 12345; List <TenRidesCard> cards = new List <TenRidesCard> { new TenRidesCard { CardCode = 12345, Rides = 10 } }; //Act TenRidesCard expResult = cards[0]; TenRidesCard result = new PaymentLogic().FindCard(code, cards); //Assert Assert.AreEqual(expResult, result); }
public TenRidesCard FindCard(int code, List <TenRidesCard> cards) { TenRidesCard card = cards.Where(c => c.CardCode == code).ToList()[0]; return(card); }