Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCAN4NET-171 Read new properties for downloading plugins #2294

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,22 @@ internal class MockAnalyzerInstaller : IAnalyzerInstaller
public MockAnalyzerInstaller(IList<AnalyzerPlugin> analyzerPluginsToReturn = null) =>
AnalyzerPluginsToReturn = analyzerPluginsToReturn;

public void AssertExpectedPluginsRequested(IEnumerable<string> plugins)
public void AssertOnlyExpectedPluginsRequested(IEnumerable<Plugin> plugins)
{
SuppliedPlugins.Should().HaveSameCount(plugins);
foreach (var plugin in plugins)
{
AssertExpectedPluginRequested(plugin);
}
}

public void AssertExpectedPluginRequested(string key)
public void AssertExpectedPluginRequested(Plugin plugin)
{
SuppliedPlugins.Should().NotBeEmpty("No plugins have been requested");
var found = SuppliedPlugins.Any(x => string.Equals(key, x.Key, System.StringComparison.Ordinal));
found.Should().BeTrue("Expected plugin was not requested. Id: {0}", key);
var suppliedPlugin = SuppliedPlugins.SingleOrDefault(x => x.Key == plugin.Key);
suppliedPlugin.Should().NotBeNull("Expected plugin was not requested. Id: {0}", plugin.Key);
suppliedPlugin.Version.Should().Be(plugin.Version);
suppliedPlugin.StaticResourceName.Should().Be(plugin.StaticResourceName);
}

IEnumerable<AnalyzerPlugin> IAnalyzerInstaller.InstallAssemblies(IEnumerable<Plugin> plugins)
Expand Down
Loading
Loading