public PersonsControllerTests() { _fixture = new Fixture(); var transactionManager = new MockTransactionManager(); _dataService = Substitute.For <IPersonDataService>(); _personsController = new PersonsController(transactionManager, _dataService); _personResponse = _fixture.Create <PersonResponse>(); _personResponse.Count = 0; }
public AccountServiceTests() { _fixture = new Fixture(); _accountRepository = Substitute.For <IAccountRepository>(); _userService = Substitute.For <IUserService>(); var logger = Substitute.For <ILogger <UserService> >(); var transactionManager = new MockTransactionManager(); _accountService = new AccountService( _accountRepository, _userService, transactionManager, logger); }
public void Should_rollback() { MockTransactionManager mockTransactionManager = UnitOfWork.GetCurrentTransactionManager() as MockTransactionManager; mockTransactionManager.TransactionRolledBack.ShouldEqual(true); }
public void Should_commit_the_transaction() { MockTransactionManager mockTransactionManager = UnitOfWork.GetCurrentTransactionManager() as MockTransactionManager; mockTransactionManager.TransactionCommitted.ShouldEqual(true); }
public void Should_begin_the_transaction() { MockTransactionManager mockTransactionManager = UnitOfWork.GetCurrentTransactionManager() as MockTransactionManager; mockTransactionManager.TransactionBegan.ShouldEqual(true); }
public void Should_not_commit() { MockTransactionManager mockTransactionManager = UnitOfWork.GetCurrentTransactionManager() as MockTransactionManager; mockTransactionManager.TransactionCommitted.ShouldEqual(false); }