예제 #1
0
        public void WhenErrorIsThrownWillRollbackTransaction()
        {
            BulkInsertFibonacciToDatabase fibonaci = new BulkInsertFibonacciToDatabase(25, Should.Throw);

            fibonaci.Execute();
            Assert.Equal(1, new List <Exception>(fibonaci.GetAllErrors()).Count);
            AssertFibonacciTableEmpty();
        }
예제 #2
0
        public void CanInsertToDatabaseFromInMemoryCollection()
        {
            BulkInsertFibonacciToDatabase fibonacci = new BulkInsertFibonacciToDatabase(25, Should.WorkFine);

            fibonacci.Execute();

            Assert25ThFibonacci();
        }
예제 #3
0
        public async Task CanInsertToDatabaseFromInMemoryCollection()
        {
            await EnsureFibonacciTableExists();

            BulkInsertFibonacciToDatabase fibonacci = new BulkInsertFibonacciToDatabase(25, Should.WorkFine);
            await fibonacci.Execute();

            await Assert25ThFibonacci();
        }
예제 #4
0
        public void CanInsertToDatabaseFromConnectionStringSettingsAndInMemoryCollection()
        {
            using (var fibonacci = new BulkInsertFibonacciToDatabase(TestDatabase.ConnectionString, 25, Should.WorkFine))
            {
                fibonacci.Execute();
            }

            Assert25ThFibonacci();
        }
예제 #5
0
        public async Task WhenErrorIsThrownWillRollbackTransaction()
        {
            await EnsureFibonacciTableExists();

            BulkInsertFibonacciToDatabase fibonaci = new BulkInsertFibonacciToDatabase(25, Should.Throw);
            await fibonaci.Execute();

            Assert.Single(new List <Exception>(fibonaci.GetAllErrors()));
            await AssertFibonacciTableEmpty();
        }
예제 #6
0
        public void WhenErrorIsThrownWillRollbackTransaction()
        {
            using (var fibonacci = new BulkInsertFibonacciToDatabase(TestDatabase.ConnectionString, 25, Should.Throw))
            {
                fibonacci.Execute();
                Assert.Single(new List <Exception>(fibonacci.GetAllErrors()));
            }

            AssertFibonacciTableEmpty();
        }