public void WhenErrorIsThrownWillRollbackTransaction()
        {
            BatchFibonacci fibonaci = new BatchFibonacci(25, Should.Throw);

            fibonaci.Execute();
            Assert.Equal(1, new List <Exception>(fibonaci.GetAllErrors()).Count);
            AssertFibonacciTableEmpty();
        }
        public void CanInsertToDatabaseFromInMemoryCollection()
        {
            BatchFibonacci fibonaci = new BatchFibonacci(25, Should.WorkFine);

            fibonaci.Execute();

            Assert25ThFibonacci();
        }
Esempio n. 3
0
        public async Task CanInsertToDatabaseFromInMemoryCollection()
        {
            await EnsureFibonacciTableExists();

            BatchFibonacci fibonaci = new BatchFibonacci(25, Should.WorkFine);
            await fibonaci.Execute();

            await Assert25ThFibonacci();
        }
Esempio n. 4
0
        public void CanInsertToDatabaseFromConnectionStringSettingsAndInMemoryCollection()
        {
            using (var fibonacci = new BatchFibonacci(TestDatabase.ConnectionString, 25, Should.WorkFine))
            {
                fibonacci.Execute();
            }

            Assert25ThFibonacci();
        }
Esempio n. 5
0
        public async Task WhenErrorIsThrownWillRollbackTransaction()
        {
            await EnsureFibonacciTableExists();

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

            Assert.Single(new List <Exception>(fibonaci.GetAllErrors()));
            await AssertFibonacciTableEmpty();
        }
Esempio n. 6
0
        public void WhenErrorIsThrownWillRollbackTransaction()
        {
            using (var fibonacci = new BatchFibonacci(TestDatabase.ConnectionStringName, 25, Should.Throw))
            {
                fibonacci.Execute();
                Assert.Single(new List <Exception>(fibonacci.GetAllErrors()));
            }

            AssertFibonacciTableEmpty();
        }