|
17 | 17 | using System;
|
18 | 18 | using System.Collections.Generic;
|
19 | 19 | using System.IO.Abstractions;
|
| 20 | +using System.Reflection; |
20 | 21 | using Microsoft.Extensions.Logging;
|
21 | 22 | using Monai.Deploy.InformaticsGateway.Api;
|
22 | 23 | using Monai.Deploy.InformaticsGateway.Common;
|
| 24 | +using Monai.Deploy.InformaticsGateway.ExecutionPlugins; |
23 | 25 | using Monai.Deploy.InformaticsGateway.Services.Common;
|
24 | 26 | using Monai.Deploy.InformaticsGateway.SharedTest;
|
25 | 27 | using Monai.Deploy.InformaticsGateway.Test.Plugins;
|
@@ -52,17 +54,19 @@ public void RegisteredPlugins_WhenCalled_ReturnsListOfPlugins()
|
52 | 54 | p => VerifyPlugin(p, typeof(TestInputDataPluginAddWorkflow)),
|
53 | 55 | p => VerifyPlugin(p, typeof(TestInputDataPluginResumeWorkflow)),
|
54 | 56 | p => VerifyPlugin(p, typeof(TestInputDataPluginModifyDicomFile)),
|
55 |
| - p => VerifyPlugin(p, typeof(TestInputDataPluginVirtualAE))); |
| 57 | + p => VerifyPlugin(p, typeof(TestInputDataPluginVirtualAE)), |
| 58 | + p => VerifyPlugin(p, typeof(ExternalAppIncoming))); |
56 | 59 |
|
57 |
| - _logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginAddWorkflow).Name}: {typeof(TestInputDataPluginAddWorkflow).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once()); |
58 |
| - _logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginResumeWorkflow).Name}: {typeof(TestInputDataPluginResumeWorkflow).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once()); |
59 |
| - _logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginModifyDicomFile).Name}: {typeof(TestInputDataPluginModifyDicomFile).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once()); |
60 |
| - _logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginVirtualAE).Name}: {typeof(TestInputDataPluginVirtualAE).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once()); |
| 60 | + _logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginAddWorkflow).GetCustomAttribute<PluginNameAttribute>()?.Name}: {typeof(TestInputDataPluginAddWorkflow).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once()); |
| 61 | + _logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginResumeWorkflow).GetCustomAttribute<PluginNameAttribute>()?.Name}: {typeof(TestInputDataPluginResumeWorkflow).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once()); |
| 62 | + _logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginModifyDicomFile).GetCustomAttribute<PluginNameAttribute>()?.Name}: {typeof(TestInputDataPluginModifyDicomFile).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once()); |
| 63 | + _logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginVirtualAE).GetCustomAttribute<PluginNameAttribute>()?.Name}: {typeof(TestInputDataPluginVirtualAE).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once()); |
| 64 | + _logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(ExternalAppIncoming).GetCustomAttribute<PluginNameAttribute>()?.Name}: {typeof(ExternalAppIncoming).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once()); |
61 | 65 | }
|
62 | 66 |
|
63 | 67 | private void VerifyPlugin(KeyValuePair<string, string> values, Type type)
|
64 | 68 | {
|
65 |
| - Assert.Equal(values.Key, type.Name); |
| 69 | + Assert.Equal(values.Key, type.GetCustomAttribute<PluginNameAttribute>()?.Name); |
66 | 70 | Assert.Equal(values.Value, type.GetShortTypeAssemblyName());
|
67 | 71 | }
|
68 | 72 | }
|
|
0 commit comments