public void TransactionAttribute_Begins_Transaction_On_Action_Executing_With_No_Isolation_Level() { var attr = new TransactionAttribute { Connection = ConnectionMock.Object }; attr.OnActionExecuting(new ActionExecutingContext()); ConnectionMock.Verify(c => c.BeginTransaction()); ContextMock.Verify(cx => cx.Bind(TransactionMock.Object)); }
public void TransactionAttribute_Begins_Transaction_With_Specified_Isolation_Level() { var attr = new TransactionAttribute { Connection = ConnectionMock.Object, IsolationLevel = IsolationLevel.Snapshot }; attr.OnActionExecuting(new ActionExecutingContext()); ConnectionMock.Verify(c => c.BeginTransaction(IsolationLevel.Snapshot)); ContextMock.Verify(cx => cx.Bind(TransactionMock.Object)); }
public void BeginATransactionOnASessionOnActionExecuting() { _attr.OnActionExecuting(_context); Isolate.Verify.WasCalledWithAnyArguments(() => _session.BeginTransaction()); }