public void ShouldBeValid() { var report = new ExpenseReport(); report.Status = ExpenseReportStatus.Submitted; var employee = new Employee(); report.Approver = employee; var command = new SubmittedToApprovedCommand(); Assert.That(command.IsValid(new ExecuteTransitionCommand(report, null, employee, new DateTime())), Is.True); }
public void ShouldBeValid() { var order = new ExpenseReport(); order.Status = ExpenseReportStatus.Submitted; var employee = new Employee(); order.Approver = employee; var command = new SubmittedToApprovedCommand(order, employee); Assert.That(command.IsValid(), Is.True); }
public void ShouldNotBeValidInWrongStatus() { var order = new ExpenseReport(); order.Status = ExpenseReportStatus.Draft; var employee = new Employee(); order.Approver = employee; var command = new SubmittedToApprovedCommand(); Assert.That(command.IsValid(new ExecuteTransitionCommand(order, null, employee, new DateTime())), Is.False); }
public void ShouldNotBeValidWithWrongApprover() { var report = new ExpenseReport(); report.Status = ExpenseReportStatus.Submitted; var employee = new Employee(); report.Approver = employee; var differentEmployee = new Employee(); var command = new SubmittedToApprovedCommand(); Assert.That(command.IsValid(new ExecuteTransitionCommand(report, null, differentEmployee, new DateTime())), Is.False); }
public void ShouldNotBeValidWithWrongEmployee() { var order = new ExpenseReport(); order.Status = ExpenseReportStatus.Draft; var employee = new Employee(); var differentEmployee = new Employee(); order.Approver = employee; var command = new SubmittedToApprovedCommand(order, differentEmployee); Assert.That(command.IsValid(), Is.False); }
public void ShouldBeValidWithOnBehalfApprover() { var report = new ExpenseReport(); report.Status = ExpenseReportStatus.Submitted; var manager = new Manager(); var assistant = new Employee(); manager.AdminAssistant = assistant; report.Approver = manager; var command = new SubmittedToApprovedCommand(); Assert.That(command.IsValid(new ExecuteTransitionCommand(report, null, assistant, new DateTime())), Is.True); }