Пример #1
0
        public void ShouldNotBeValidWithWrongEmployee()
        {
            var order = new ExpenseReport();

            order.Status = ExpenseReportStatus.Draft;
            var employee = new Employee();

            order.Submitter = employee;

            var command = new DraftingCommand();

            Assert.That(command.IsValid(new ExecuteTransitionCommand(order, null, new Employee(), new DateTime())), Is.False);
        }
Пример #2
0
        public void ShouldBeValid()
        {
            var order = new ExpenseReport();

            order.Status = ExpenseReportStatus.Draft;
            var employee = new Employee();

            order.Submitter = employee;

            var command = new DraftingCommand(order, employee);

            Assert.That(command.IsValid(), Is.True);
        }
Пример #3
0
        public void ShouldNotBeValidInWrongStatus()
        {
            var order = new ExpenseReport();

            order.Status = ExpenseReportStatus.Submitted;
            var employee = new Employee();

            order.Submitter = employee;

            var command = new DraftingCommand(order, employee);

            Assert.That(command.IsValid(), Is.False);
        }
Пример #4
0
        public void ShouldNotBeValidInWrongStatus()
        {
            var report = new ExpenseReport();

            report.Status = ExpenseReportStatus.Submitted;
            var employee = new Employee();

            report.Submitter = employee;

            var command = new DraftingCommand();

            Assert.That(command.IsValid(new ExecuteTransitionCommand(report, null, employee, new DateTime())), Is.False);
        }