Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Represents the **NuGet** versions.

## v5.11.1
- *Fixed:* Wrapped `Assembly.LoadFrom` in `TestSetUp` with try-catch to log exceptions and prevent setup failures.

## v5.11.0
- *Enhancement:* Added `AssertorBase.LogMessages` to enable access to the logs captured during execution of the test for assertion purposes. This is intended to be used in conjunction with the existing `ExpectLogContains` expectation to enable additional (more advanced) assertions against the logs.

Expand Down
2 changes: 1 addition & 1 deletion Common.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>5.11.0</Version>
<Version>5.11.1</Version>
<LangVersion>preview</LangVersion>
<Authors>Avanade</Authors>
<Company>Avanade</Company>
Expand Down
12 changes: 11 additions & 1 deletion src/UnitTestEx/TestSetUp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,17 @@ static TestSetUp()
{
// Load all dependent assemblies to ensure all one off test set up(s) execute before any test exection is perfomed.
foreach (var fi in new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory).EnumerateFiles("*.dll"))
Assembly.LoadFrom(fi.FullName);
{
try
{
Assembly.LoadFrom(fi.FullName);
}
catch (Exception ex)
{
// Ignore any load failures; this is not a problem as the assembly may not be relevant to the current test execution.
Comment thread
Copilot marked this conversation as resolved.
Outdated
System.Diagnostics.Debug.WriteLine($"TestSetUp: Unable to load assembly '{fi.FullName}': {ex.Message}");
}
Comment thread
chullybun marked this conversation as resolved.
}

// Wire up for any assemblies already loaded.
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
Expand Down
Loading