예제 #1
0
        public void ChangeStatus(Employee employee, DateTime date, ExpenseReportStatus beginStatus, ExpenseReportStatus endStatus)
        {
            var auditItem = new AuditEntry(employee, date, beginStatus, endStatus);

            _auditEntries.Add(auditItem);
            Status = endStatus;
        }
예제 #2
0
        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(" "));
        }
예제 #3
0
        public virtual void ChangeStatus(Employee employee, DateTime date, ExpenseReportStatus status)
        {
            var auditItem = new AuditEntry(employee, date, Status, status);

            _auditEntries.Add(auditItem);
            Status = status;
        }
예제 #4
0
 public virtual void ChangeStatus(Employee employee, DateTime date, ExpenseReportStatus status)
 {
     var auditItem = new AuditEntry(employee, date, Status, status);
     _auditEntries.Add(auditItem);
     Status = status;
 }
예제 #5
0
 public void AddAuditEntry(AuditEntry auditEntry)
 {
     _auditEntries.Add(auditEntry);
 }
예제 #6
0
 public void AddAuditEntry(AuditEntry auditEntry)
 {
     _auditEntries.Add(auditEntry);
 }
예제 #7
0
 public void AddAuditEntry(AuditEntry auditEntry)
 {
     auditEntry.ExpenseReport = this;
     _auditEntries.Add(auditEntry);
 }