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);
            }
        }
        public ActionResult StartingList(string nazwisko)
        {
            List <VStartingLists> result = new List <VStartingLists>();

            if (String.IsNullOrEmpty(nazwisko))
            {
                result = istartGroup.getAllList();
            }
            else
            {
                result = istartGroup.getSpecificList(nazwisko, istartGroup);
            }
            return(View(result));
        }
示例#3
0
        public void Test_getSpecificLists_byNameParticipant_returnRoswByList_id()
        {
            //arrange
            var result = iTrueparticipant.getSpecificList("marcin", iFakeparticipant);
            //act
            var target = iFakeparticipant.getAllList();

            //assert
            try
            {
                NUnit.Framework.Assert.Greater(result.Count, 1);
            }
            catch (AssertionException aex)
            {
                string err = aex.Message;
            }
        }