public void RetrieveAll_WhenCalled_ReturnsEmployeesList()
 {
     for (int i = 0; i < 2; i++)
     {
         PersistenceObjectRepository <Employee> .Create(newEmployeeSample());
     }
     Expect(PersistenceObjectRepository <Employee> .RetrieveAll().Count, Is.EqualTo(2));
 }
        public void Truncate_WhenCalledOnEmployee_DeletesAllEmployees()
        {
            PersistenceObjectRepository <Employee> .Create(newEmployeeSample());


            PersistenceObjectRepository <Employee> .Truncate();

            Expect(() => PersistenceObjectRepository <Employee> .RetrieveAll().Count, Is.EqualTo(0));
        }
Пример #3
0
        /// <summary>
        /// بازیابی خطا ها
        /// </summary>
        /// <returns>لیستی از تمام خطا ها</returns>
        public List <Log> RetrieveLogs()
        {
            var logList = PersistenceObjectRepository <Log> .RetrieveAll();

            foreach (Log log in logList)
            {
                log.Picture = m_logPictureRepository.Read(log.ID.ToString());
            }
            return(logList);
        }
        public void Truncate_WhenCalledOnContactInformation_DeletesAllContactInformations()
        {
            var contactInformation = PersistenceObjectRepository <ContactInformation> .Create(newContactInformationSample());

            var employee = PersistenceObjectRepository <Employee> .Create(newEmployeeSample(contactInformation));

            PersistenceObjectRepository <ContactInformation> .Truncate();

            Expect(() => PersistenceObjectRepository <ContactInformation> .RetrieveAll().Count, Is.EqualTo(0));
        }
Пример #5
0
        /// <summary>
        ///بازیابی تمام کارمندان
        /// </summary>
        /// <returns>لیستی از تمام کارمندان</returns>
        public List <Employee> RetrieveEmployees()
        {
            var employeeList = PersistenceObjectRepository <Employee> .RetrieveAll();

            foreach (Employee e in employeeList)
            {
                e.ProfilePicture = m_profilePictureRepository.Read(e.ID.ToString());
            }

            return(employeeList);
        }
        public void RetrieveAll_WhenCalled_ReturnsContactInformationList()
        {
            for (int i = 0; i < 2; i++)
            {
                var contactInformation = PersistenceObjectRepository <ContactInformation> .Create(newContactInformationSample());

                var employee = PersistenceObjectRepository <Employee> .Create(newEmployeeSample(contactInformation));
            }

            Expect(PersistenceObjectRepository <ContactInformation> .RetrieveAll().Count, Is.EqualTo(2));
        }
Пример #7
0
 /// <summary>
 /// برگرداندن لیست تمامی ساعات حضور
 /// </summary>
 /// <returns>لیستی از تمام ساعات حضور</returns>
 public List <AttendanceTime> RetrieveAttendanceTimes()
 {
     return(PersistenceObjectRepository <AttendanceTime> .RetrieveAll());
 }