public void WhenErrorIsThrownWillRollbackTransaction() { OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(25, Should.Throw); fibonaci.Execute(); Assert.AreEqual(1, new List<Exception>(fibonaci.GetAllErrors()).Count); AssertFibonacciTableEmpty(); }
public void CanInsertToDatabaseFromInMemoryCollection() { OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(25, Should.WorkFine); fibonaci.Execute(); Assert25ThFibonacci(); }
public void WhenErrorIsThrownWillRollbackTransaction() { OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(25, Should.Throw); fibonaci.Execute(); Assert.Equal(1, new List <Exception>(fibonaci.GetAllErrors()).Count); AssertFibonacciTableEmpty(); }
public async Task CanInsertToDatabaseFromInMemoryCollection() { await EnsureFibonacciTableExists(); OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(25, Should.WorkFine); await fibonaci.Execute(); await Assert25ThFibonacci(); }
public void CanInsertToDatabaseFromConnectionStringSettingsAndInMemoryCollection() { using (var fibonacci = new OutputFibonacciToDatabase(TestDatabase.ConnectionString, 25, Should.WorkFine)) { fibonacci.Execute(); } Assert25ThFibonacci(); }
public async Task WhenErrorIsThrownWillRollbackTransaction() { await EnsureFibonacciTableExists(); OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(25, Should.Throw); await fibonaci.Execute(); Assert.Single(new List <Exception>(fibonaci.GetAllErrors())); await AssertFibonacciTableEmpty(); }
public void WhenErrorIsThrownWillRollbackTransaction() { using (var fibonacci = new OutputFibonacciToDatabase(TestDatabase.ConnectionStringName, 25, Should.Throw)) { fibonacci.Execute(); Assert.Single(new List <Exception>(fibonacci.GetAllErrors())); } AssertFibonacciTableEmpty(); }
public void WillRaiseRowProcessedEvent() { int rowsProcessed = 0; using (OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(1, Should.WorkFine)) { fibonaci.OutputOperation.OnRowProcessed += delegate { rowsProcessed++; }; fibonaci.Execute(); } Assert.Equal(1, rowsProcessed); }
public void WillRaiseFinishedProcessingEventOnce() { int finished = 0; using (OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(1, Should.WorkFine)) { fibonaci.OutputOperation.OnFinishedProcessing += delegate { finished++; }; fibonaci.Execute(); } Assert.AreEqual(1, finished); }
public void WillRaiseRowProcessedEvent() { int rowsProcessed = 0; using (OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(1, Should.WorkFine)) { fibonaci.OutputOperation.OnRowProcessed += delegate { rowsProcessed++; }; fibonaci.Execute(); } Assert.AreEqual(1, rowsProcessed); }
public void WillRaiseFinishedProcessingEventOnce() { int finished = 0; using (OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(1, Should.WorkFine)) { fibonaci.OutputOperation.OnFinishedProcessing += delegate { finished++; }; fibonaci.Execute(); } Assert.Equal(1, finished); }
public void WillRaiseRowProcessedEventUntilItThrows() { int rowsProcessed = 0; using (OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(25, Should.Throw)) { fibonaci.OutputOperation.OnRowProcessed += delegate { rowsProcessed++; }; fibonaci.Execute(); Assert.Equal(fibonaci.ThrowingOperation.RowsAfterWhichToThrow, rowsProcessed); } }
public void WillRaiseRowProcessedEventUntilItThrows() { int rowsProcessed = 0; using (OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(25, Should.Throw)) { fibonaci.OutputOperation.OnRowProcessed += delegate { rowsProcessed++; }; fibonaci.Execute(); Assert.AreEqual(fibonaci.ThrowingOperation.RowsAfterWhichToThrow, rowsProcessed); } }
public async Task WillRaiseFinishedProcessingEventOnce() { await EnsureFibonacciTableExists(); int finished = 0; using (OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(1, Should.WorkFine)) { fibonaci.OutputOperation.OnFinishedProcessing += delegate { finished++; }; await fibonaci.Execute(); } Assert.Equal(1, finished); }
public async Task WillRaiseRowProcessedEventUntilItThrows() { await EnsureFibonacciTableExists(); int rowsProcessed = 0; using (OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(25, Should.Throw)) { fibonaci.OutputOperation.OnRowProcessed += delegate { rowsProcessed++; }; await fibonaci.Execute(); Assert.Equal(fibonaci.ThrowingOperation.RowsAfterWhichToThrow, rowsProcessed); } }
public async Task WillRaiseRowProcessedEvent() { await EnsureFibonacciTableExists(); int rowsProcessed = 0; using (OutputFibonacciToDatabase fibonaci = new OutputFibonacciToDatabase(1, Should.WorkFine)) { fibonaci.OutputOperation.OnRowProcessed += delegate { rowsProcessed++; }; await fibonaci.Execute(); } Assert.Equal(1, rowsProcessed); }