public StateMachineManager(
     IOptions <StateMachineOptions> options,
     ILogger <StateMachineManager> logger,
     IStateMachineManagerDataService dataService)
 {
     this.options     = options.Value ?? StateMachineOptions.Default;
     this.logger      = logger;
     this.dataService = dataService;
 }
            public TestCaseContext()
            {
                Options       = StateMachineOptions.Default;
                TransitionKey = "transtion";
                State1Key     = "state1";
                State2Key     = "state2";
                Transition    = new Transition {
                    Key = TransitionKey, NextStateKey = State1Key
                };
                InitialState = new State
                {
                    Key         = Options.InitialStateKey,
                    Transitions = new List <Transition> {
                        Transition
                    }
                };
                FinalState = new State {
                    Key = Options.FinalStateKey
                };
                State1 = new State {
                    Key = State1Key
                };
                State2 = new State {
                    Key = State2Key
                };

                OptionsService = Mock.Of <IOptions <StateMachineOptions> >();
                Logger         = Mock.Of <ILogger <StateMachineManager> >();
                DataService    = Mock.Of <IStateMachineManagerDataService>();

                Mock.Get(OptionsService).Setup(
                    m => m.Value)
                .Returns(Options);

                Mock.Get(DataService).Setup(
                    m => m.LoadState(Options.InitialStateKey, It.IsAny <CancellationToken>()))
                .ReturnsAsync(InitialState);
                Mock.Get(DataService).Setup(
                    m => m.LoadState(Options.FinalStateKey, It.IsAny <CancellationToken>()))
                .ReturnsAsync(FinalState);
                Mock.Get(DataService).Setup(
                    m => m.LoadState(State1Key, It.IsAny <CancellationToken>()))
                .ReturnsAsync(State1);
                Mock.Get(DataService).Setup(
                    m => m.LoadState(State2Key, It.IsAny <CancellationToken>()))
                .ReturnsAsync(State2);
            }