using System; using HeuristicLab.Services.Hive; namespace HeuristicLab.Clients.Hive.Tests { public class MockServiceLocator : IServiceLocator { private string username; public string Username { get { return username; } set { username = value; } } private string password; public string Password { get { return password; } set { password = value; } } public HeuristicLab.Services.Hive.Common.ServiceContracts.IHiveService GetService() { HiveService service = new HeuristicLab.Services.Hive.HiveService(); return service; } public void CallHiveService(Action call) { call(GetService()); } public T CallHiveService(Func call) { return call(GetService()); } #region IServiceLocator Members public void CallHiveService(Action call) { // how to do this? } public T CallHiveService(Func call) { // how to do this? throw new NotImplementedException(); } #endregion } }