Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Wolfgang.Etl.TestKit.Xunit/EtlPipelineContractTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public async Task Pipeline_progress_counts_all_records_extracted_and_loaded_Asyn

var final = capture.FinalReport;
Assert.NotNull(final);
Assert.Equal(source.Count, final!.ExtractedItemCount);
Assert.Equal(source.Count, final.ExtractedItemCount);
Assert.Equal(source.Count, final.LoadedItemCount);
Assert.Equal(0, final.ErrorItemCount);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Wolfgang.Etl.TestKit.Xunit/EtlScenarioOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public async Task RunAndAssertAsync(IReadOnlyList<T> expectedLoaded, int expecte

Assert.Equal(expectedLoaded, loader.GetCollectedItems());
Assert.NotNull(capture.FinalReport);
Assert.Equal(expectedErrors, capture.FinalReport!.ErrorItemCount);
Assert.Equal(expectedErrors, capture.FinalReport.ErrorItemCount);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public abstract class IdempotentLoaderContractTests<TSut, TItem>
/// </remarks>
/// <param name="sut">The system under test, after a load has completed.</param>
protected virtual int GetCurrentItemCount(TSut sut) =>
((LoaderBase<TItem, Report>)(object)sut!).CurrentItemCount;
((LoaderBase<TItem, Report>)(object)sut).CurrentItemCount;



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public abstract class IdempotentTransformerContractTests<TSut, TItem>
/// </remarks>
/// <param name="sut">The system under test, after a transform has completed.</param>
protected virtual int GetCurrentItemCount(TSut sut) =>
((TransformerBase<TItem, TItem, Report>)(object)sut!).CurrentItemCount;
((TransformerBase<TItem, TItem, Report>)(object)sut).CurrentItemCount;



Expand Down
2 changes: 1 addition & 1 deletion src/Wolfgang.Etl.TestKit/TestExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ [EnumeratorCancellation] CancellationToken token
// it changes no observable extraction result (the source is synchronous).
await Task.Yield();

var enumerator = (_enumerator ?? _enumerable!.GetEnumerator())!;
var enumerator = (_enumerator ?? _enumerable!.GetEnumerator());
var ownsEnumerator = _enumerator == null;

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void From_To_delivers_the_source_in_order_and_counts_both_ends()

Assert.Equal(items, loader.Loaded);
Assert.NotNull(last);
Assert.Equal(items.Length, last!.ExtractedItemCount);
Assert.Equal(items.Length, last.ExtractedItemCount);
Assert.Equal(items.Length, last.LoadedItemCount);
},
iter: Iterations);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void Report_metrics_are_internally_consistent()
{
// Percentage is always clamped to [0, 100].
Assert.NotNull(report.PercentComplete);
Assert.InRange(report.PercentComplete!.Value, 0d, 100d);
Assert.InRange(report.PercentComplete.Value, 0d, 100d);

// Once the count reaches the total, nothing remains.
if (current >= total.Value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public async Task With_no_injected_source_the_real_system_clock_is_used()
var after = DateTimeOffset.UtcNow;

Assert.NotNull(sut.PeekStartedAt);
Assert.InRange(sut.PeekStartedAt!.Value, before.AddSeconds(-1), after.AddSeconds(1));
Assert.InRange(sut.PeekStartedAt.Value, before.AddSeconds(-1), after.AddSeconds(1));
Assert.True(sut.PeekElapsed >= TimeSpan.Zero);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void LoaderBase_CreateProgressTimer_returns_a_started_timer()
using var timer = loader.CallCreateProgressTimer();

Assert.NotNull(core);
Assert.Equal(321, core!.LastDueTime); // CreateProgressTimer called Start(ReportingInterval)
Assert.Equal(321, core.LastDueTime); // CreateProgressTimer called Start(ReportingInterval)
Assert.Equal(321, core.LastPeriod);
}

Expand All @@ -137,7 +137,7 @@ public void TransformerBase_CreateProgressTimer_returns_a_started_timer()
using var timer = transformer.CallCreateProgressTimer();

Assert.NotNull(core);
Assert.Equal(654, core!.LastDueTime);
Assert.Equal(654, core.LastDueTime);
Assert.Equal(654, core.LastPeriod);
}

Expand All @@ -151,7 +151,7 @@ public void ExtractorBase_CreateProgressTimer_returns_a_started_timer()
using var timer = extractor.CallCreateProgressTimer();

Assert.NotNull(core);
Assert.Equal(111, core!.LastDueTime);
Assert.Equal(111, core.LastDueTime);
Assert.Equal(111, core.LastPeriod);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public async Task ExtractAsync_with_progress_and_injected_timer_reports_progress
while (await enumerator.MoveNextAsync()) { }

Assert.NotNull(captured);
Assert.True(captured!.CurrentItemCount >= 1);
Assert.True(captured.CurrentItemCount >= 1);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ public async Task LoadAsync_stops_the_injected_timer_in_the_finally()
private static async IAsyncEnumerable<int> GatedSourceAsync(TaskCompletionSource<bool> gate)
{
yield return 1;
#pragma warning disable VSTHRD003 // awaiting a test-gate TaskCompletionSource is intentional
await gate.Task.ConfigureAwait(false);
#pragma warning restore VSTHRD003
yield return 2;
yield return 3;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Wolfgang.Etl.TestKit.Tests.Unit/FaultyLoaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public async Task LoadAsync_with_progress_and_injected_timer_reports_progress_wh
await task;

Assert.NotNull(captured);
Assert.True(captured!.CurrentItemCount >= 1);
Assert.True(captured.CurrentItemCount >= 1);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public async Task TransformAsync_with_progress_and_injected_timer_reports_progre
while (await enumerator.MoveNextAsync()) { }

Assert.NotNull(captured);
Assert.True(captured!.CurrentItemCount >= 1);
Assert.True(captured.CurrentItemCount >= 1);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ public async Task ExtractAsync_with_progress_and_injected_timer_reports_progress
while (await enumerator.MoveNextAsync()) { }

Assert.NotNull(captured);
Assert.True(captured!.CurrentItemCount >= 1);
Assert.True(captured.CurrentItemCount >= 1);
}


Expand Down
2 changes: 1 addition & 1 deletion tests/Wolfgang.Etl.TestKit.Tests.Unit/TestLoaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public async Task LoadAsync_with_progress_and_injected_timer_reports_progress_wh
await task;

Assert.NotNull(captured);
Assert.True(captured!.CurrentItemCount >= 1);
Assert.True(captured.CurrentItemCount >= 1);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public async Task TransformAsync_with_progress_and_injected_timer_reports_progre
while (await enumerator.MoveNextAsync()) { }

Assert.NotNull(captured);
Assert.True(captured!.CurrentItemCount >= 1);
Assert.True(captured.CurrentItemCount >= 1);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ await EtlPipeline
var final = capture.FinalReport;
Assert.NotNull(final);
// One error skipped in the extractor + one in the loader.
Assert.Equal(2, final!.ErrorItemCount);
Assert.Equal(2, final.ErrorItemCount);
}


Expand Down Expand Up @@ -64,6 +64,6 @@ await EtlPipeline
var final = capture.FinalReport;
Assert.NotNull(final);
// One error skipped in each of the extractor, transformer, and loader.
Assert.Equal(3, final!.ErrorItemCount);
Assert.Equal(3, final.ErrorItemCount);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ await EtlPipeline

var final = capture.FinalReport;
Assert.NotNull(final);
Assert.Equal(1, final!.ErrorItemCount);
Assert.Equal(1, final.ErrorItemCount);
Assert.Equal(4, final.LoadedItemCount);
}

Expand Down
Loading