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
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@ bin
obj

# mstest test results
TestResults
TestResults

# Misc
_ReSharper.*
*.user
*.suo
*.crunchproject.local.xml
*.crunchsolution.local.xml
*.ncrunchsolution
*.ncrunchproject
20 changes: 16 additions & 4 deletions ConventionTests/ConventionTests.NUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,22 @@ protected virtual Assembly[] GetAssembliesToScan(ConventionData data)
protected virtual Type[] GetTypesToTest(ConventionData data)
{
return
GetAssembliesToScan(data).SelectMany(a => a.GetTypes()).Where(data.Types.Invoke).OrderBy(t => t.FullName)
.ToArray();
}
}
GetAssembliesToScan(data).SelectMany(GetTypesSafely).Where(data.Types.Invoke).OrderBy(t => t.FullName)
.ToArray();
}

private static IEnumerable<Type> GetTypesSafely(Assembly assembly)
{
try
{
return assembly.GetTypes();
}
catch (ReflectionTypeLoadException ex)
{
return ex.Types.Where(x => x != null);
}
}
}

public abstract class WindsorConventionTest<TDiagnostic> : WindsorConventionTest<TDiagnostic, IHandler>
where TDiagnostic : class, IDiagnostic<IEnumerable<IHandler>>, IDiagnostic<object>
Expand Down