Last change
on this file since 6486 was
6452,
checked in by cneumuel, 14 years ago
|
#1233
- renamed UptimeCalendar and Appointment to Downtime
- added service methods to delete plugins and get plugin by hash
- made reverted TransactionManager change, made it non-static and added interface
- moved magic numbers to application settings
|
File size:
1.2 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using HeuristicLab.Services.Hive;
|
---|
3 |
|
---|
4 | namespace HeuristicLab.Clients.Hive.Tests {
|
---|
5 | public class MockServiceLocator : IServiceLocator {
|
---|
6 | private string username;
|
---|
7 | public string Username {
|
---|
8 | get { return username; }
|
---|
9 | set { username = value; }
|
---|
10 | }
|
---|
11 |
|
---|
12 | private string password;
|
---|
13 | public string Password {
|
---|
14 | get { return password; }
|
---|
15 | set { password = value; }
|
---|
16 | }
|
---|
17 |
|
---|
18 | public HeuristicLab.Services.Hive.Common.ServiceContracts.IHiveService GetService() {
|
---|
19 | HiveService service = new HeuristicLab.Services.Hive.HiveService();
|
---|
20 | return service;
|
---|
21 | }
|
---|
22 |
|
---|
23 | public void CallHiveService(Action<HeuristicLab.Services.Hive.Common.ServiceContracts.IHiveService> call) {
|
---|
24 | call(GetService());
|
---|
25 | }
|
---|
26 |
|
---|
27 | public T CallHiveService<T>(Func<HeuristicLab.Services.Hive.Common.ServiceContracts.IHiveService, T> call) {
|
---|
28 | return call(GetService());
|
---|
29 | }
|
---|
30 |
|
---|
31 | #region IServiceLocator Members
|
---|
32 |
|
---|
33 | public void CallHiveService(Action<IHiveService> call) {
|
---|
34 | // how to do this?
|
---|
35 | }
|
---|
36 |
|
---|
37 | public T CallHiveService<T>(Func<IHiveService, T> call) {
|
---|
38 | // how to do this?
|
---|
39 | throw new NotImplementedException();
|
---|
40 | }
|
---|
41 |
|
---|
42 | #endregion
|
---|
43 | }
|
---|
44 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.