public void Should_dispose_and_throw_the_generated_exception_if_the_action_fails() { InputEntity1 input = new InputEntity1(); Assert.Throws<Exception>(() => _atomicRequestHandler.Invoke<InputEntity1, InputEntity1>(input, Failure)); sessionContainer.AssertWasNotCalled(x => x.Commit()); sessionContainer.AssertWasCalled(x => x.Dispose()); }
public void Should_dispose_and_throw_the_generated_exception_if_the_action_fails() { InputEntity1 input = new InputEntity1(); Assert.Throws <Exception>(() => _atomicRequestHandler.Invoke <InputEntity1, InputEntity1>(input, Failure)); sessionContainer.AssertWasNotCalled(x => x.Commit()); sessionContainer.AssertWasCalled(x => x.Dispose()); }
public void Should_commit_if_the_action_was_success() { InputEntity1 input = new InputEntity1(); _atomicRequestHandler.Invoke<InputEntity1, InputEntity1>(input, Success); sessionContainer.AssertWasCalled(x => x.Commit()); sessionContainer.AssertWasCalled(x => x.Dispose()); }
public void Should_commit_if_the_action_was_success() { InputEntity1 input = new InputEntity1(); _atomicRequestHandler.Invoke <InputEntity1, InputEntity1>(input, Success); sessionContainer.AssertWasCalled(x => x.Commit()); sessionContainer.AssertWasCalled(x => x.Dispose()); }
public InputEntity1 Failure(InputEntity1 entity1, InputEntity2 entity2) { throw new Exception(); }
public InputEntity1 Success(InputEntity1 entity1, InputEntity2 entity2) { return(entity1); }
public InputEntity1 Success(InputEntity1 entity1) { return entity1; }
public InputEntity1 Success(InputEntity1 entity1, InputEntity2 entity2) { return entity1; }