コード例 #1
0
        private Task RunStateMachineWithError(Func <string, IStateMachine> getter, string innerXml)
        {
            // arrange
            var stateMachine = getter(innerXml);

            // act
            async Task Action() => await StateMachineInterpreter.RunAsync(stateMachine, _eventChannel, _options);

            // assert
            return(Assert.ThrowsExceptionAsync <StateMachineDestroyedException>(Action));
        }
コード例 #2
0
        private async Task RunStateMachine(Func <string, IStateMachine> getter, string innerXml)
        {
            var stateMachine = getter(innerXml);

            try
            {
                await StateMachineInterpreter.RunAsync(SessionId.New(), stateMachine, _eventChannel, _options);

                Assert.Fail("StateMachineQueueClosedException should be raised");
            }
            catch (StateMachineQueueClosedException)
            {
                //ignore
            }
        }