Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/ConsoleTests/MockPluginService.cs @ 6372

Last change on this file since 6372 was 6357, checked in by cneumuel, 13 years ago

#1233

  • refactoring of slave core
  • created JobManager, which is responsible for managing jobs without knowing anything about the service. this class is easier testable than slave core
  • lots of cleanup
  • created console test project for slave
File size: 820 bytes
Line 
1using System;
2using System.Collections.Generic;
3using HeuristicLab.Clients.Hive.SlaveCore;
4using HeuristicLab.Services.Hive.Common.DataTransfer;
5
6namespace HeuristicLab.Clients.Hive.Slave.Tests {
7  public class MockPluginService : IPluginProvider {
8
9    public Dictionary<Guid, Plugin> Plugins;
10    public Dictionary<Guid, List<PluginData>> PluginDatas;
11
12    public MockPluginService() {
13      this.Plugins = new Dictionary<Guid, Plugin>();
14      this.PluginDatas = new Dictionary<Guid, List<PluginData>>();
15    }
16
17    public Plugin GetPlugin(Guid pluginId) {
18      return Plugins[pluginId];
19    }
20
21    public IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds) {
22      foreach(var id in pluginIds)
23        foreach(var pd in PluginDatas[id])
24          yield return pd;
25    }
26  }
27}
Note: See TracBrowser for help on using the repository browser.