public void AttributeShouldUseConfigurationTransactionMode() { Nails.Configure().UnitOfWork.DefaultTransactionMode(TransactionMode.NoTransaction); var info = UnitOfWorkInfo.From(GetType().GetMethod("MethodWithDefaultUnitOfWorkAttribute")); Assert.IsFalse(info.IsTransactional); }
public void FromMethodWithAllowAsyncAttribute() { Nails.Configure().UnitOfWork.DefaultAsyncMode(false) .AllowAsyncExecution(true); var info = UnitOfWorkInfo.From(GetType().GetMethod("AsyncMethod")); Assert.IsTrue(info.IsAsync); }
public void FromMethodShouldNotBeAsyncByDefaultIfDefaultIsNotAsync() { Nails.Configure().UnitOfWork.DefaultAsyncMode(false) .AllowAsyncExecution(true); var info = UnitOfWorkInfo.From(GetType().GetMethod("MethodWithoutAttributes")); Assert.IsFalse(info.IsAsync); }
public void ShouldNotBeAsyncByDefaultIfDefaultIsNotAsync() { Nails.Configure().UnitOfWork.DefaultAsyncMode(true) .AllowAsyncExecution(true); var info = new UnitOfWorkInfo(); Assert.IsFalse(info.IsAsync); }
public void ShouldIgnoreWithAllowAsyncAttributeIfAsyncExecutionIsNotAllowed() { Nails.Configure().UnitOfWork.DefaultAsyncMode(false) .AllowAsyncExecution(false); var info = UnitOfWorkInfo.From(GetType().GetMethod("AsyncMethod")); Assert.IsFalse(info.IsAsync); }
public void ShouldIgnoreDefaultIfNotFromMethod() { Nails.Configure().UnitOfWork.DefaultAsyncMode(true) .AllowAsyncExecution(true); var info = new UnitOfWorkInfo(); Assert.IsFalse(info.IsAsync); }
public void FromMethodShouldBeTransactionalByDefault() { var info = UnitOfWorkInfo.From(GetType().GetMethod("MethodWithDefaultUnitOfWorkAttribute")); Assert.IsTrue(info.IsTransactional); }
public void ShouldBeTransactionalByDefault() { var info = new UnitOfWorkInfo(); Assert.IsTrue(info.IsTransactional); }
public void MethodWithoutUnitOfWorkAttributeShouldHaveDeafaultValues() { var info = UnitOfWorkInfo.From(GetType().GetMethod("MethodWithoutAttributes")); Assert.IsTrue(info.IsTransactional); }