public void Given_a_CommandManager_When_Executing_with_Exception_And_no_Completed_Handler_Should_throw_Exception() { var aggregator = new Mock <IEventAggregator>(); CommandManager manager = new CommandManager(aggregator.Object, SynchronizationContext.Current); ThrowingCommand cmd = new ThrowingCommand(); manager.Do(Execute.The(cmd)); }
public void Given_a_CommandManager_When_Executing_with_Exception_CurrentTransaction_is_null() { var aggregator = new Mock <IEventAggregator>(); CommandManager manager = new CommandManager(aggregator.Object, SynchronizationContext.Current); ThrowingCommand cmd = new ThrowingCommand(); manager.Do(Execute.The(cmd).AndWhenCompletedCall(state => { })); Assert.IsTrue(manager.CurrentTransaction == null); }
public void HandleCommand(ThrowingCommand c) { throw new Exception("Exception from throwing command."); }