Skip to content

Commit 1bef12c

Browse files
committed
fdsf
1 parent 84ec8e5 commit 1bef12c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Coderr.Client.Tests/Config/ContextCollections/ObjectToContextCollectionConverterTests.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.ComponentModel.DataAnnotations;
44
using System.Globalization;
55
using System.Linq;
6+
using System.Reflection;
67
using Coderr.Client.ContextCollections;
78
using Coderr.Client.Tests.TestObjects;
89
using FluentAssertions;
@@ -202,10 +203,17 @@ public void should_be_able_to_serialize_all_types_of_exceptions()
202203
var sut = new ObjectToContextCollectionConverter();
203204

204205
var inner = new Exception("hello");
205-
var exceptionTypes =
206-
AppDomain.CurrentDomain.GetAssemblies()
206+
List<Type> exceptionTypes;
207+
try
208+
{
209+
exceptionTypes = AppDomain.CurrentDomain.GetAssemblies()
207210
.SelectMany(assembly => assembly.GetTypes().Where(y => typeof(Exception).IsAssignableFrom(y)))
208211
.ToList();
212+
}
213+
catch (ReflectionTypeLoadException ex)
214+
{
215+
throw ex.LoaderExceptions[0];
216+
}
209217

210218
foreach (var exceptionType in exceptionTypes)
211219
{

0 commit comments

Comments
 (0)