Changeset 5526 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/Mocks/MockServiceLocator.cs
- Timestamp:
- 02/21/11 17:35:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/Mocks/MockServiceLocator.cs
r5405 r5526 1 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using HeuristicLab.Clients.Common; 2 using HeuristicLab.Services.Hive; 6 3 using HeuristicLab.Services.Hive.Common.ServiceContracts; 7 using HeuristicLab.Services.Hive;8 4 9 5 namespace HeuristicLab.Clients.Hive.Tests { 10 6 public class MockServiceLocator : IServiceLocator { 11 public Disposable<IHiveService> GetService() { 12 return new Disposable<IHiveService>(new HiveService()); 7 private string username; 8 public string Username { 9 get { return username; } 10 set { username = value; } 13 11 } 14 12 15 public Disposable<IHiveService> GetService(string username, string password) { 16 return GetService(); 13 private string password; 14 public string Password { 15 get { return password; } 16 set { password = value; } 17 } 18 19 public IHiveService GetService() { 20 return new HiveService(); 21 } 22 23 public void CallHiveService(Action<IHiveService> call) { 24 call(GetService()); 25 } 26 27 public T CallHiveService<T>(Func<IHiveService, T> call) { 28 return call(GetService()); 17 29 } 18 30 }
Note: See TracChangeset
for help on using the changeset viewer.