예제 #1
0
 public UserAttendanceRepositoryMock()
 {
     Attendances = new List <Attendance>
     {
         Attendance.CreateAttendance(1, new Guid(), new Guid().ToString(), 10, 10, false)
     };
 }
예제 #2
0
        public void StartLaboratoryBasedOnValue(Guid factionId, int labValue)
        {
            var laboratory  = Guid.NewGuid();
            var studentList = _service.GetUsersByFactionId(factionId);
            var getUser     = _userRepo.GetAllUsers().FirstOrDefault(user => user.FactionId == factionId);
            var check       = _attendance.GetAllAttendances()
                              .Where(attend => attend.UserId == getUser.Id && attend.LaboratoryNumber == labValue).ToList().Count;

            if (check == 0)
            {
                foreach (var students in studentList)
                {
                    _attendance.CreateAttendance(
                        Attendance.CreateAttendance(
                            labValue,
                            laboratory,
                            students.Id,
                            0,
                            0,
                            false
                            ));
                }
            }
        }