- Timestamp:
- 06/21/11 16:51:03 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockAuthorizationManager.cs
r6457 r6463 24 24 namespace HeuristicLab.Services.Hive.Tests.Mocks { 25 25 public class MockAuthorizationManager : IAuthorizationManager { 26 public static Guid MockUserId1 = new Guid("6C7911A1-46EA-4E51-97DF-5582653AAFCE"); 27 public static Guid MockUserId2 = new Guid("897660EB-C90F-4054-988C-D39D530A0A02"); 28 public static Guid MockUserId3 = new Guid("9F7B4EA8-A38D-4BC2-802F-E148AC7A6A87"); 29 30 private Guid userId = MockUserId1; 31 32 public Guid UserId { 33 get { return userId; } 26 public void Authorize(Guid userId) { 27 // ok. 34 28 } 35 29 36 public void Authorize Jobs(params Guid[] jobId) {37 // o .k.30 public void AuthorizeForJob(Guid jobId, Common.DataTransfer.Permission requiredPermission) { 31 // ok. 38 32 } 39 33 40 public void Authorize(Guid userId) { 41 // o.k. 42 } 43 44 internal void SetUserId(Guid id) { 45 this.userId = id; 34 public void AuthorizeForExperiment(Guid experimentId, Common.DataTransfer.Permission requiredPermission) { 35 // ok. 46 36 } 47 37 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs
r6457 r6463 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Services.Hive.DataAccess; 23 24 using HeuristicLab.Services.Hive.Tests.Mocks; 24 using System;25 25 26 26 namespace HeuristicLab.Services.Hive.Tests { … … 36 36 } 37 37 38 private MockAuthorizationManager mockAuthorizationManager = new MockAuthorizationManager();38 //private MockAuthorizationManager mockAuthorizationManager = new MockAuthorizationManager(); 39 39 public IAuthorizationManager AuthorizationManager { 40 get { return mockAuthorizationManager; }40 get { return defaultServiceLocator.AuthorizationManager; } 41 41 } 42 42 … … 51 51 get { return defaultServiceLocator.TransactionManager; } 52 52 } 53 53 private MockUserManager mockUserManager = new MockUserManager(); 54 public IUserManager UserManager { 55 get { return mockUserManager; } 56 } 54 57 public HeartbeatManager HeartbeatManager { 55 58 get { return defaultServiceLocator.HeartbeatManager; } … … 57 60 58 61 #region Special mocking methods 59 public void SetCurrentUser (Guid id) {60 mock AuthorizationManager.SetUserId(id);62 public void SetCurrentUserId(Guid userId) { 63 mockUserManager.SetUserId(userId); 61 64 } 62 63 65 #endregion 64 66 }
Note: See TracChangeset
for help on using the changeset viewer.