Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mocsharp committed Aug 16, 2023
1 parent fa9dbeb commit 0400fd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Microsoft.Extensions.Logging;
using Monai.Deploy.InformaticsGateway.Api;
using Monai.Deploy.InformaticsGateway.Common;
using Monai.Deploy.InformaticsGateway.ExecutionPlugins;
using Monai.Deploy.InformaticsGateway.Services.Common;
using Monai.Deploy.InformaticsGateway.SharedTest;
using Monai.Deploy.InformaticsGateway.Test.Plugins;
Expand Down Expand Up @@ -52,12 +53,14 @@ public void RegisteredPlugins_WhenCalled_ReturnsListOfPlugins()
p => VerifyPlugin(p, typeof(TestInputDataPluginAddWorkflow)),
p => VerifyPlugin(p, typeof(TestInputDataPluginResumeWorkflow)),
p => VerifyPlugin(p, typeof(TestInputDataPluginModifyDicomFile)),
p => VerifyPlugin(p, typeof(TestInputDataPluginVirtualAE)));
p => VerifyPlugin(p, typeof(TestInputDataPluginVirtualAE)),
p => VerifyPlugin(p, typeof(ExternalAppIncoming)));

_logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginAddWorkflow).Name}: {typeof(TestInputDataPluginAddWorkflow).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
_logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginResumeWorkflow).Name}: {typeof(TestInputDataPluginResumeWorkflow).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
_logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginModifyDicomFile).Name}: {typeof(TestInputDataPluginModifyDicomFile).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
_logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(TestInputDataPluginVirtualAE).Name}: {typeof(TestInputDataPluginVirtualAE).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
_logger.VerifyLogging($"{typeof(IInputDataPlugin).Name} data plug-in found {typeof(ExternalAppIncoming).Name}: {typeof(ExternalAppIncoming).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
}

private void VerifyPlugin(KeyValuePair<string, string> values, Type type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Microsoft.Extensions.Logging;
using Monai.Deploy.InformaticsGateway.Api;
using Monai.Deploy.InformaticsGateway.Common;
using Monai.Deploy.InformaticsGateway.ExecutionPlugins;
using Monai.Deploy.InformaticsGateway.Services.Common;
using Monai.Deploy.InformaticsGateway.SharedTest;
using Monai.Deploy.InformaticsGateway.Test.Plugins;
Expand Down Expand Up @@ -50,10 +51,13 @@ public void RegisteredPlugins_WhenCalled_ReturnsListOfPlugins()

Assert.Collection(result,
p => VerifyPlugin(p, typeof(TestOutputDataPluginAddMessage)),
p => VerifyPlugin(p, typeof(TestOutputDataPluginModifyDicomFile)));
p => VerifyPlugin(p, typeof(TestOutputDataPluginModifyDicomFile)),
p => VerifyPlugin(p, typeof(ExternalAppOutgoing))
);

_logger.VerifyLogging($"{typeof(IOutputDataPlugin).Name} data plug-in found {typeof(TestOutputDataPluginAddMessage).Name}: {typeof(TestOutputDataPluginAddMessage).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
_logger.VerifyLogging($"{typeof(IOutputDataPlugin).Name} data plug-in found {typeof(TestOutputDataPluginModifyDicomFile).Name}: {typeof(TestOutputDataPluginModifyDicomFile).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
_logger.VerifyLogging($"{typeof(IOutputDataPlugin).Name} data plug-in found {typeof(ExternalAppOutgoing).Name}: {typeof(ExternalAppOutgoing).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
}

private void VerifyPlugin(KeyValuePair<string, string> values, Type type)
Expand Down

0 comments on commit 0400fd5

Please sign in to comment.