Exemplo n.º 1
0
        public void RollbackTransactionMustRollbackTransactionWhenCalled()
        {
            DatabaseFacadeStub database    = new DatabaseFacadeStub(new FakeDbContext(), null);
            FakeTransaction    transaction = (FakeTransaction)database.BeginTransaction();

            Assert.Equal(TransactionStatus.Active, transaction.Status);
            database.RollbackTransaction();
            Assert.Equal(TransactionStatus.Aborted, transaction.Status);
        }
Exemplo n.º 2
0
        public void BeginTransactionMustReturnFakeTransactionWhenCalled()
        {
            DatabaseFacadeStub database = new DatabaseFacadeStub(new FakeDbContext(), null);

            Assert.IsAssignableFrom <FakeTransaction>(database.BeginTransaction());
        }