Changeset 995 for trunk/sources/HeuristicLab.Hive.Server.Core/DbTestApp.cs
- Timestamp:
- 12/16/08 17:26:43 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Core/DbTestApp.cs
r971 r995 43 43 client.Login = DateTime.Now; 44 44 client.ClientId = Guid.NewGuid(); 45 clientAdapter.Update Client(client);45 clientAdapter.Update(client); 46 46 47 47 ClientInfo clientRead = 48 clientAdapter.Get ClientById(client.ClientId);48 clientAdapter.GetById(client.ClientId); 49 49 Debug.Assert( 50 50 clientRead != null && … … 52 52 53 53 client.CpuSpeedPerCore = 2000; 54 clientAdapter.Update Client(client);54 clientAdapter.Update(client); 55 55 clientRead = 56 clientAdapter.Get ClientById(client.ClientId);56 clientAdapter.GetById(client.ClientId); 57 57 Debug.Assert( 58 58 clientRead != null && … … 60 60 clientRead.CpuSpeedPerCore == 2000); 61 61 62 ICollection<ClientInfo> clients = clientAdapter.GetAllClients(); 62 ICollection<ClientInfo> clients = 63 clientAdapter.GetAll(); 63 64 int count = clients.Count; 64 65 65 clientAdapter.Delete Client(client);66 67 clients = clientAdapter.GetAll Clients();66 clientAdapter.Delete(client); 67 68 clients = clientAdapter.GetAll(); 68 69 Debug.Assert(count - 1 == clients.Count); 69 70 } … … 74 75 75 76 User user = new User(); 76 user.Name = " Stefan";77 78 userAdapter.Update User(user);77 user.Name = "TestDummy"; 78 79 userAdapter.Update(user); 79 80 80 81 User userRead = 81 userAdapter.Get UserById(user.PermissionOwnerId);82 userAdapter.GetById(user.Id); 82 83 Debug.Assert( 83 84 userRead != null && 84 user. PermissionOwnerId == userRead.PermissionOwnerId);85 user.Id == userRead.Id); 85 86 86 87 user.Password = "passme"; 87 userAdapter.Update User(user);88 userAdapter.Update(user); 88 89 userRead = 89 userAdapter.Get UserByName(user.Name);90 userAdapter.GetByName(user.Name); 90 91 Debug.Assert( 91 92 userRead != null && … … 93 94 userRead.Password == user.Password); 94 95 95 ICollection<User> users = userAdapter.GetAllUsers(); 96 ICollection<User> users = 97 userAdapter.GetAll(); 96 98 int count = users.Count; 97 99 98 userAdapter.Delete User(user);99 100 users = userAdapter.GetAll Users();100 userAdapter.Delete(user); 101 102 users = userAdapter.GetAll(); 101 103 Debug.Assert(count - 1 == users.Count); 102 104 } … … 129 131 group.Members.Add(subGroup); 130 132 131 userGroupAdapter.Update UserGroup(group);133 userGroupAdapter.Update(group); 132 134 133 135 UserGroup read = 134 userGroupAdapter.Get UserGroupById(group.PermissionOwnerId);136 userGroupAdapter.GetById(group.Id); 135 137 136 138 ICollection<UserGroup> userGroups = 137 userGroupAdapter.GetAll UserGroups();139 userGroupAdapter.GetAll(); 138 140 139 141 IUserAdapter userAdapter = 140 142 ServiceLocator.GetUserAdapter(); 141 143 142 userAdapter.Delete User(user3);144 userAdapter.Delete(user3); 143 145 144 146 read = 145 userGroupAdapter.Get UserGroupById(group.PermissionOwnerId);146 147 userGroupAdapter.Delete UserGroup(subGroup);148 149 read = 150 userGroupAdapter.Get UserGroupById(group.PermissionOwnerId);147 userGroupAdapter.GetById(group.Id); 148 149 userGroupAdapter.Delete(subGroup); 150 151 read = 152 userGroupAdapter.GetById(group.Id); 151 153 152 154 userGroups = 153 userGroupAdapter.GetAll UserGroups();154 155 userGroupAdapter.Delete UserGroup(group);155 userGroupAdapter.GetAll(); 156 157 userGroupAdapter.Delete(group); 156 158 157 159 userGroups = 158 userGroupAdapter.GetAll UserGroups();159 160 userAdapter.Delete User(user);161 userAdapter.Delete User(user2);160 userGroupAdapter.GetAll(); 161 162 userAdapter.Delete(user); 163 userAdapter.Delete(user2); 162 164 } 163 165 … … 195 197 group.Resources.Add(subGroup); 196 198 197 clientGroupAdapter.Update ClientGroup(group);199 clientGroupAdapter.Update(group); 198 200 199 201 ClientGroup read = 200 clientGroupAdapter.Get ClientGroupById(group.ResourceId);202 clientGroupAdapter.GetById(group.Id); 201 203 202 204 ICollection<ClientGroup> clientGroups = 203 clientGroupAdapter.GetAll ClientGroups();205 clientGroupAdapter.GetAll(); 204 206 205 207 IClientAdapter clientAdapter = 206 208 ServiceLocator.GetClientAdapter(); 207 209 208 clientAdapter.Delete Client(client3);209 210 read = 211 clientGroupAdapter.Get ClientGroupById(group.ResourceId);212 213 clientGroupAdapter.Delete ClientGroup(subGroup);214 215 read = 216 clientGroupAdapter.Get ClientGroupById(group.ResourceId);210 clientAdapter.Delete(client3); 211 212 read = 213 clientGroupAdapter.GetById(group.Id); 214 215 clientGroupAdapter.Delete(subGroup); 216 217 read = 218 clientGroupAdapter.GetById(group.Id); 217 219 218 220 clientGroups = 219 clientGroupAdapter.GetAll ClientGroups();220 221 clientGroupAdapter.Delete ClientGroup(group);221 clientGroupAdapter.GetAll(); 222 223 clientGroupAdapter.Delete(group); 222 224 223 225 clientGroups = 224 clientGroupAdapter.GetAll ClientGroups();225 226 clientAdapter.Delete Client(client);227 clientAdapter.Delete Client(client2);226 clientGroupAdapter.GetAll(); 227 228 clientAdapter.Delete(client); 229 clientAdapter.Delete(client2); 228 230 } 229 231 … … 238 240 239 241 job.Client = client; 240 jobAdapter.Update Job(job);241 242 ICollection<Job> jobs = jobAdapter.GetAll Jobs();243 244 jobAdapter.Delete Job(job);245 246 jobs = jobAdapter.GetAll Jobs();242 jobAdapter.Update(job); 243 244 ICollection<Job> jobs = jobAdapter.GetAll(); 245 246 jobAdapter.Delete(job); 247 248 jobs = jobAdapter.GetAll(); 247 249 } 248 250 249 251 public override void Run() { 250 TestClientAdapter();251 TestUserAdapter();252 TestUserGroupAdapter();253 TestClientGroupAdapter();254 TestJobAdapter();255 256 252 ITransactionManager transactionManager = 257 253 ServiceLocator.GetTransactionManager(); 258 254 255 TestClientAdapter(); 259 256 transactionManager.UpdateDB(); 257 258 TestUserAdapter(); 259 transactionManager.UpdateDB(); 260 261 TestUserGroupAdapter(); 262 transactionManager.UpdateDB(); 263 264 TestClientGroupAdapter(); 265 transactionManager.UpdateDB(); 266 267 TestJobAdapter(); 268 transactionManager.UpdateDB(); 260 269 } 261 270 }
Note: See TracChangeset
for help on using the changeset viewer.