Exemple #1
0
        public async Task <ActionResult <IEnumerable <Timesheet> > > GetTimesheets()
        {
            List <TimesheetViewModel> tsList = new List <TimesheetViewModel>();

            foreach (Timesheet ts in await _timesheetRepository.GetAll())
            {
                tsList.Add(new TimesheetViewModel(await GetFullTimesheetDetails(ts)));
            }

            return(Ok(tsList));
        }
        public void GetAllTest()
        {
            var emprepo = new TimesheetRepository(empcontextmock.Object);
            var emplist = emprepo.GetAll();

            Assert.AreEqual(2, emplist.Count());
        }