Пример #1
0
        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;
        }
Пример #2
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);
        }
Пример #3
0
        public void Should_rollback()
        {
            MockTransactionManager mockTransactionManager = UnitOfWork.GetCurrentTransactionManager() as MockTransactionManager;

            mockTransactionManager.TransactionRolledBack.ShouldEqual(true);
        }
Пример #4
0
        public void Should_commit_the_transaction()
        {
            MockTransactionManager mockTransactionManager = UnitOfWork.GetCurrentTransactionManager() as MockTransactionManager;

            mockTransactionManager.TransactionCommitted.ShouldEqual(true);
        }
Пример #5
0
        public void Should_begin_the_transaction()
        {
            MockTransactionManager mockTransactionManager = UnitOfWork.GetCurrentTransactionManager() as MockTransactionManager;

            mockTransactionManager.TransactionBegan.ShouldEqual(true);
        }
Пример #6
0
        public void Should_not_commit()
        {
            MockTransactionManager mockTransactionManager = UnitOfWork.GetCurrentTransactionManager() as MockTransactionManager;

            mockTransactionManager.TransactionCommitted.ShouldEqual(false);
        }