Closed ChangeTheCode closed 1 year ago
I think you're right here, your approach is cleaner and should be used in the example. I believe it was there due to the fact that we had a different loading mechanism in the past, which needed the class reference. Do you care to create a PR to fix it?
@fgather I will create a PR to adapt this in the example
I have a question about you example for loading the assemblies.
Create a Test
private static readonly Architecture Architecture = new ArchLoader().LoadAssemblies(typeof(ExampleClass).Assembly, typeof(ForbiddenClass).Assembly) .Build();
You using a class instance to find the correct assembly to load it. This will assume that the class instance is in the correct assembly. From my point of view it could be that someone move this class and then the test isn't testing what it should.
From my point of view it would make more sense to use the
System.Reflection.Assembly.Load("AssemblyName")
. Advantages:So now my question is there any reason which I didn't saw yet to use the class instances instead of loading the assembly by using the assembly name?