public void Test_getOneParticipantById_resultDefault_paramWrong() { //arrange var target = ikartoteka2InfoFake.getEmptyResult(); //act var result = ikartoteka2InfoTrue.getOneParticipantById(ikartoteka2InfoFake, 101); //assert Assert.AreEqual(target.kart_imie, result.kart_imie); Assert.AreEqual(target.kart_nazwisko, result.kart_nazwisko); Assert.AreEqual(target.kart_email, result.kart_email); }
public kartoteka2 getOneParticipantById(IKartoteka2Info allParticipant, int kart_id) { var result = allParticipant.getInformationAboutAllParticipant(); result = result.Where(x => x.kart_id == kart_id).ToList(); if (!result.Any()) { return(allParticipant.getEmptyResult()); } else { return(result.First()); } }