Skip to content

Commit

Permalink
fixing errors
Browse files Browse the repository at this point in the history
Signed-off-by: Neil South <[email protected]>
  • Loading branch information
neildsouth committed Sep 7, 2023
1 parent a974b0b commit 37b81b6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/InformaticsGateway/Common/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Type GetType(this Type interfaceType, string typeString)
{
var assembly = AppDomain.CurrentDomain.GetAssemblies().ToList().Find(z => !string.IsNullOrWhiteSpace(z.FullName) && z.FullName.StartsWith(name.FullName));
assembly ??= Assembly.Load(Path.Combine(SR.PlugInDirectoryPath, $"{name.Name}.dll"));
assembly ??= Assembly.LoadFile(Path.Combine(SR.PlugInDirectoryPath, $"{name.Name}.dll"));

Check warning on line 60 in src/InformaticsGateway/Common/TypeExtensions.cs

View workflow job for this annotation

GitHub Actions / unit-test

Replace this call to 'Assembly.LoadFile' with 'Assembly.Load'.
return assembly;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void LoadAssembliesFromPlugInsDirectory()
foreach (var file in files)
{
_logger.LoadingAssembly(file);
var assembly = Assembly.Load(file);
var assembly = Assembly.LoadFile(file);
var matchingTypes = assembly.GetTypes().Where(p => _type.IsAssignableFrom(p) && p != _type).ToList();

AddToCache(matchingTypes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public async Task GivenAnInputDataPlugInEngine_WhenExecutePlugInsIsCalledWithout
"calling",
"called");

await Assert.ThrowsAsync<ApplicationException>(async () => await pluginEngine.ExecutePlugInsAsync(dicomFile, dicomInfo));
await Assert.ThrowsAsync<PlugInInitializationException>(async () => await pluginEngine.ExecutePlugInsAsync(dicomFile, dicomInfo));
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public async Task GivenAnOutputDataPlugInEngine_WhenExecutePlugInsIsCalledWithou
WorkflowInstanceId = Guid.NewGuid().ToString(),
}, "filename.dcm");

await Assert.ThrowsAsync<ApplicationException>(async () => await pluginEngine.ExecutePlugInsAsync(message));
await Assert.ThrowsAsync<PlugInInitializationException>(async () => await pluginEngine.ExecutePlugInsAsync(message));
}

[Fact]
Expand Down

0 comments on commit 37b81b6

Please sign in to comment.