public void ResetAllCommand_WhenExecuteMethodIsCalled_EmployeeIsReset() { //Mock Employee employeeInstance = getEmployeeInstance(employee_Ahmad_Rahimi_0004000001); employeeInstance.WorkSchedule = WorkSchedule.MinValue; employeeInstance.ContactInformations.Add(CommonTestCaseSourceProvider.newContactInformationSample()); //Test // Expect(() => employee_Ahmad_Rahimi_0004000001.ResetAllCommand.Execute(null), Throws.Nothing); Expect(() => employee_Ahmad_Rahimi_0004000001.FirstName, Is.Null); Expect(() => employeeInstance.WorkSchedule, Is.EqualTo(WorkSchedule.MinValue)); Expect(() => employeeInstance.ContactInformations[0].Label, Is.EqualTo(null)); Expect(() => employeeInstance.ContactInformations.Count, Is.EqualTo(0)); }
private Employee util_createSampleEmployeeAndContactInformation() { ContactInformation contactInformation = null; Employee employee = null; Expect(() => { contactInformation = AutomatedAttendanceSystem.CreateContactInformation(CommonTestCaseSourceProvider.newContactInformationSample()); }, Throws.Nothing); Expect(() => { employee = AutomatedAttendanceSystem.CreateEmployee(CommonTestCaseSourceProvider.newEmployeeSample(contactInformation)); }, Throws.Nothing); return(employee); }
public void RegisterEmployeeEntryTime_WhenCalled_RegistersEntryTimeInDatabase() { ContactInformation contactInformation = null; Employee employee = null; Expect(() => { contactInformation = AutomatedAttendanceSystem.CreateContactInformation(CommonTestCaseSourceProvider.newContactInformationSample()); }, Throws.Nothing); Expect(() => { employee = AutomatedAttendanceSystem.CreateEmployee(CommonTestCaseSourceProvider.newEmployeeSample(contactInformation)); }, Throws.Nothing); DateTime entryTime = DateTime.Now; AttendanceTime attendanceTime = null; Expect(() => { attendanceTime = AutomatedAttendanceSystem.RegisterEmployeeEntryTime(employee); }, Throws.Nothing); Expect(() => attendanceTime.ID, Is.Not.EqualTo(Guid.Empty)); Expect(() => AutomatedAttendanceSystem.RetrieveAttendanceTimes().Count, Is.EqualTo(1)); }
public void RetrieveAttendanceTimes_WhenCalled_ReturnsListOfAllAttendanceTimes() { ContactInformation contactInformation = null; Employee employee = null; Expect(() => { contactInformation = AutomatedAttendanceSystem.CreateContactInformation(CommonTestCaseSourceProvider.newContactInformationSample()); }, Throws.Nothing); Expect(() => { employee = AutomatedAttendanceSystem.CreateEmployee(CommonTestCaseSourceProvider.newEmployeeSample(contactInformation)); }, Throws.Nothing); Expect(() => { PersistenceObjectRepository <AttendanceTime> .Create(CommonTestCaseSourceProvider.newAttendanceTimeSample(employee)); }, Throws.Nothing); Expect(() => AutomatedAttendanceSystem.RetrieveAttendanceTimes().Count, Is.GreaterThan(0)); }
public void CreateContactInformation_ProvidedWithContactInformation_SavesInDatabase() { var contactInformation = AutomatedAttendanceSystem.CreateContactInformation(CommonTestCaseSourceProvider.newContactInformationSample()); Expect(() => contactInformation.ID, Is.Not.EqualTo(Guid.Empty)); }