public void TestLoadDifferentPluginTypes() { var cache = new PluginCache(_pluginLoader.Object); cache.LoadAllOfType <ILogFileOutlinePlugin>(); _pluginLoader.Verify(x => x.LoadAllOfTypeWithDescription <ILogFileOutlinePlugin>(), Times.Once); _pluginLoader.Verify(x => x.LoadAllOfTypeWithDescription <ILogEntryParserPlugin>(), Times.Never); cache.LoadAllOfType <ILogEntryParserPlugin>(); _pluginLoader.Verify(x => x.LoadAllOfTypeWithDescription <ILogFileOutlinePlugin>(), Times.Once); _pluginLoader.Verify(x => x.LoadAllOfTypeWithDescription <ILogEntryParserPlugin>(), Times.Once); }
public void TestLoadDifferentPluginTypes() { var cache = new PluginCache(_pluginLoader.Object); cache.LoadAllOfType <IWidgetPlugin>(); _pluginLoader.Verify(x => x.LoadAllOfType <IWidgetPlugin>(), Times.Once); _pluginLoader.Verify(x => x.LoadAllOfType <ILogAnalyserPlugin>(), Times.Never); cache.LoadAllOfType <ILogAnalyserPlugin>(); _pluginLoader.Verify(x => x.LoadAllOfType <IWidgetPlugin>(), Times.Once); _pluginLoader.Verify(x => x.LoadAllOfType <ILogAnalyserPlugin>(), Times.Once); }
public void TestLoadPluginOnlyOnce() { var cache = new PluginCache(_pluginLoader.Object); cache.LoadAllOfType <ILogFileOutlinePlugin>(); _pluginLoader.Verify(x => x.LoadAllOfTypeWithDescription <ILogFileOutlinePlugin>(), Times.Once); _pluginLoader.Verify(x => x.LoadAllOfTypeWithDescription <ILogEntryParserPlugin>(), Times.Never); cache.LoadAllOfType <ILogFileOutlinePlugin>(); _pluginLoader.Verify(x => x.LoadAllOfTypeWithDescription <ILogFileOutlinePlugin>(), Times.Once, "because the cache should not have queried the plugin loader again"); _pluginLoader.Verify(x => x.LoadAllOfTypeWithDescription <ILogEntryParserPlugin>(), Times.Never); }
public void TestLoadPluginOnlyOnce() { var cache = new PluginCache(_pluginLoader.Object); cache.LoadAllOfType <IWidgetPlugin>(); _pluginLoader.Verify(x => x.LoadAllOfType <IWidgetPlugin>(), Times.Once); _pluginLoader.Verify(x => x.LoadAllOfType <ILogAnalyserPlugin>(), Times.Never); cache.LoadAllOfType <IWidgetPlugin>(); _pluginLoader.Verify(x => x.LoadAllOfType <IWidgetPlugin>(), Times.Once, "because the cache should not have queried the plugin loader again"); _pluginLoader.Verify(x => x.LoadAllOfType <ILogAnalyserPlugin>(), Times.Never); }