public void ChangeStatus(Employee employee, DateTime date, ExpenseReportStatus beginStatus, ExpenseReportStatus endStatus) { var auditItem = new AuditEntry(employee, date, beginStatus, endStatus); _auditEntries.Add(auditItem); Status = endStatus; }
public void PropertiesShouldGetAndSetValuesProperly() { var report = new ExpenseReport(); Guid guid = Guid.NewGuid(); var creator = new Employee(); var assignee = new Employee(); DateTime auditDate = new DateTime(2000, 1, 1, 8, 0, 0); AuditEntry testAudit = new AuditEntry(creator, auditDate, ExpenseReportStatus.Submitted, ExpenseReportStatus.Approved); report.Id = guid; report.Title = "Title"; report.Description = "Description"; report.Status = ExpenseReportStatus.Approved; report.Number = "Number"; report.Submitter = creator; report.Approver = assignee; report.AddAuditEntry(testAudit); Assert.That(report.Id, Is.EqualTo(guid)); Assert.That(report.Title, Is.EqualTo("Title")); Assert.That(report.Description, Is.EqualTo("Description")); Assert.That(report.Status, Is.EqualTo(ExpenseReportStatus.Approved)); Assert.That(report.Number, Is.EqualTo("Number")); Assert.That(report.Submitter, Is.EqualTo(creator)); Assert.That(report.Approver, Is.EqualTo(assignee)); Assert.That(report.GetAuditEntries()[0].BeginStatus, Is.EqualTo(ExpenseReportStatus.Submitted)); Assert.That(report.GetAuditEntries()[0].EndStatus, Is.EqualTo(ExpenseReportStatus.Approved)); Assert.That(report.GetAuditEntries()[0].Date, Is.EqualTo(auditDate)); Assert.That(report.GetAuditEntries()[0].ArchivedEmployeeName, Is.EqualTo(" ")); }
public virtual void ChangeStatus(Employee employee, DateTime date, ExpenseReportStatus status) { var auditItem = new AuditEntry(employee, date, Status, status); _auditEntries.Add(auditItem); Status = status; }
public void AddAuditEntry(AuditEntry auditEntry) { _auditEntries.Add(auditEntry); }
public void AddAuditEntry(AuditEntry auditEntry) { auditEntry.ExpenseReport = this; _auditEntries.Add(auditEntry); }