示例#1
0
        public void DefaultStateMachineName(
            AsyncActiveStateMachine <string, int> machine,
            StateMachineNameReporter reporter)
        {
            "establish an instantiated active state machine".x(()
                                                               => machine = new StateMachineDefinitionBuilder <string, int>()
                                                                            .WithInitialState("initial")
                                                                            .Build()
                                                                            .CreateActiveStateMachine());

            "establish a state machine reporter".x(()
                                                   => reporter = new StateMachineNameReporter());

            "when the state machine report is generated".x(()
                                                           => machine.Report(reporter));

            "it should use the type of the state machine as name for state machine".x(()
                                                                                      => reporter.StateMachineName
                                                                                      .Should().Be("Appccelerate.StateMachine.AsyncActiveStateMachine<System.String,System.Int32>"));
        }
示例#2
0
        public void CustomStateMachineName(
            AsyncActiveStateMachine <string, int> machine,
            StateMachineNameReporter reporter)
        {
            const string name = "custom name";

            "establish an instantiated active state machine with custom name".x(()
                                                                                => machine = new StateMachineDefinitionBuilder <string, int>()
                                                                                             .WithInitialState("initial")
                                                                                             .Build()
                                                                                             .CreateActiveStateMachine(name));

            "establish a state machine reporter".x(()
                                                   => reporter = new StateMachineNameReporter());

            "when the state machine report is generated".x(()
                                                           => machine.Report(reporter));

            "it should use custom name for state machine".x(()
                                                            => reporter.StateMachineName
                                                            .Should().Be(name));
        }