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)); }
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 } }