public void ShouldGetNoValidStateCommandsForWrongUser()
        {
            var facilitator = new WorkflowFacilitator(new StubbedCalendar(new DateTime(2000, 1, 1)));
            var report = new ExpenseReport();
            var employee = new Employee();
            IStateCommand[] commands = facilitator.GetValidStateCommands(report, employee);

            Assert.That(commands.Length, Is.EqualTo(0));
        }
        public void ShouldGetNoValidStateCommandsForWrongUser()
        {
            var facilitator = new WorkflowFacilitator();
            var report = new ExpenseReport();
            var employee = new Employee();
            IStateCommand[] commands = facilitator.GetValidStateCommands(new ExecuteTransitionCommand{Report = report, CurrentUser = employee});

            Assert.That(commands.Length, Is.EqualTo(0));
        }
        public void ShouldReturnAllStateCommandsInCorrectOrder()
        {
            var facilitator = new WorkflowFacilitator(new StubbedCalendar(new DateTime(2000, 1, 1)));
            IStateCommand[] commands = facilitator.GetAllStateCommands(new ExpenseReport(), new Employee());

            Assert.That(commands.Length, Is.EqualTo(3));

            Assert.That(commands[0], Is.InstanceOf(typeof (DraftingCommand)));
            Assert.That(commands[1], Is.InstanceOf(typeof (DraftToSubmittedCommand)));
            Assert.That(commands[2], Is.InstanceOf(typeof (SubmittedToApprovedCommand)));
        }
        public void ShouldReturnAllStateCommandsInCorrectOrder()
        {
            var facilitator = new WorkflowFacilitator();
            IStateCommand[] commands = facilitator.GetAllStateCommands();

            Assert.That(commands.Length, Is.EqualTo(4));

            Assert.That(commands[0], Is.InstanceOf(typeof (DraftingCommand)));
            Assert.That(commands[1], Is.InstanceOf(typeof (DraftToSubmittedCommand)));
            Assert.That(commands[2], Is.InstanceOf(typeof(DraftToCancelledCommand)));
            Assert.That(commands[3], Is.InstanceOf(typeof(SubmittedToApprovedCommand)));
        }