Beispiel #1
0
        public void Test_getSpecificList_byWrongNameParticipant_returnOneDefaultRow()
        {
            //arrange
            var result = iTrueparticipant.getSpecificList("nima", iFakeparticipant);
            //act
            var target = iFakeparticipant.getEmptyRow();

            //assert
            try
            {
                NUnit.Framework.Assert.AreEqual(result.First().kart_nazwisko, target.First().kart_nazwisko);
            }
            catch (AssertionException aex)
            {
                string err = aex.Message;
            }
        }
        public List <VStartingLists> getSpecificList(string nazwisko, IParticipantStartingGroup istartingGroup)
        {
            List <VStartingLists> result = new List <VStartingLists>();

            if (String.IsNullOrEmpty(nazwisko))
            {
                nazwisko = "";
            }
            var source = istartingGroup.getAllList();

            source = source.Where(x => x.kart_nazwisko.ToUpper().Contains(nazwisko.ToUpper())).ToList();
            if (!source.Any())
            {
                return(istartingGroup.getEmptyRow());
            }
            else
            {
                result = istartingGroup.getAllList().Where(x => source.Any(y => y.list_id == x.list_id)).ToList();
                return(result);
            }
        }