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
6 changes: 3 additions & 3 deletions ArchUnitNET/Loader/TypeFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ TypeReference typeReference
)
{
var assemblyQualifiedName = System.Reflection.Assembly.CreateQualifiedName(
typeReference.Module.Assembly.FullName,
typeReference.Scope.Name,
typeReference.BuildFullName()
);
if (_allTypes.TryGetValue(assemblyQualifiedName, out var existingTypeInstance))
Expand All @@ -361,8 +361,8 @@ TypeReference typeReference
typeReference.BuildFullName(),
typeReference.Name,
_assemblyRegistry.GetOrCreateAssembly(
typeReference.Module.Assembly.Name.Name,
typeReference.Module.Assembly.FullName,
typeReference.Scope.Name,
typeReference.Scope.ToString(),
true,
null
),
Expand Down
5 changes: 3 additions & 2 deletions ArchUnitNETTests/Loader/ArchLoaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public void TypesAreAssignedToCorrectAssemblies()
public void UnavailableTypeTest()
{
// When loading an assembly from a file, there are situations where the assemblies dependencies are not
// available in the current AppDomain. This test checks that the loader does not throw an exception in this
// case.
// available in the current AppDomain. This test checks that the loader does not throw an exception
// and that the unavailable types contain the correct assembly they come from.
var currentAssemblyPath = AppDomain.CurrentDomain.BaseDirectory[
..AppDomain.CurrentDomain.BaseDirectory.IndexOf(
@"ArchUnitNETTests",
Expand All @@ -153,6 +153,7 @@ public void UnavailableTypeTest()
var loggerType = architecture.ReferencedTypes.WhereFullNameIs("Serilog.ILogger");
Assert.NotNull(loggerType);
Assert.True(loggerType is UnavailableType);
Assert.Equal("Serilog", loggerType.Assembly.Name);
}
}
}