Changeset 3953
- Timestamp:
- 06/25/10 23:34:51 (14 years ago)
- Location:
- branches/HeuristicLab.Services.Authentication Prototype
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Services.Authentication Prototype/HeuristicLab.Services.Authentication Prototyp.sln
r3932 r3953 11 11 ProjectSection(SolutionItems) = preProject 12 12 HeuristicLab.Services.Authentication Prototyp.vsmdi = HeuristicLab.Services.Authentication Prototyp.vsmdi 13 HeuristicLab.Services.Authentication Prototyp1.vsmdi = HeuristicLab.Services.Authentication Prototyp1.vsmdi 13 14 LocalTestRun.testrunconfig = LocalTestRun.testrunconfig 14 15 EndProjectSection … … 16 17 Global 17 18 GlobalSection(TestCaseManagementSettings) = postSolution 18 CategoryFile = HeuristicLab.Services.Authentication Prototyp .vsmdi19 CategoryFile = HeuristicLab.Services.Authentication Prototyp1.vsmdi 19 20 EndGlobalSection 20 21 GlobalSection(SolutionConfigurationPlatforms) = preSolution -
branches/HeuristicLab.Services.Authentication Prototype/HeuristicLab.Services.Authentication Prototyp.vsmdi
r3952 r3953 1 <?xml version="1.0" encoding="UTF-8"?>1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2006"> 3 3 <TestList name="HeuristicLabRoleProviderTestList" id="5d68832d-33e3-456f-94dc-5fcdb20ad3fe" parentListId="8c43106b-9dc1-4907-a29f-aa66a61bf5b6"> … … 28 28 </TestLinks> 29 29 </TestList> 30 <TestList name="RoleProviderTest" id="5163da73-f948-4da0-ac41-d4a3a5eb1677" parentListId="8c43106b-9dc1-4907-a29f-aa66a61bf5b6"> 31 <TestLinks> 32 <TestLink id="3463a5ed-c3f1-6729-be85-dc5e0d4df6bd" name="CreateRoleTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 33 <TestLink id="b076f1b4-7085-972e-6b44-f9169d06d257" name="HeuristicLabRoleProviderConstructorTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 34 <TestLink id="903719dc-469b-6714-449e-0d776b005bcf" name="RoleExistsTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 35 </TestLinks> 36 </TestList> 30 37 </TestLists> -
branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabRoleProvider.cs
r3952 r3953 22 22 23 23 public override void CreateRole(string roleName) { 24 throw new NotImplementedException(); 24 CreateRole(roleName, false); 25 26 } 27 28 public virtual void CreateRole(String roleName, bool isPermission) { 29 Persistence.DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext(); 30 HeuristicLabRole role = new HeuristicLabRole(); 31 role.RoleName = roleName; 32 role.IsPermission = isPermission; 33 db.HeuristicLabRole.InsertOnSubmit(role); 34 db.SubmitChanges(); 25 35 } 26 36 … … 30 40 31 41 public override string[] FindUsersInRole(string roleName, string usernameToMatch) { 32 throw new NotImplementedException( );42 throw new NotImplementedException("not implemented"); 33 43 } 34 44 … … 75 85 Persistence.DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext(); 76 86 bool returnValue = (DatabaseUtil.createDataClassesDataContext().HeuristicLabRole.Count(r => r.RoleName == roleName) == 1); 77 db. Connection.Close();87 db.Dispose(); 78 88 return returnValue; 79 89 -
branches/HeuristicLab.Services.Authentication Prototype/UnitTests/HeuristicLabRoleProviderTest.cs
r3952 r3953 1 1 using Service.Provider; 2 2 using Microsoft.VisualStudio.TestTools.UnitTesting; 3 using System.Linq; 3 4 namespace UnitTests { 4 5 /// <summary> … … 76 77 Persistence.HeuristicLabRole role = new Persistence.HeuristicLabRole(); 77 78 role.RoleName = TEST_ROLE_NAME; 78 Persistence.DataClassesDataContext db = Persistence.DatabaseUtil.createDataClassesDataContext();79 79 db.HeuristicLabRole.InsertOnSubmit((Persistence.HeuristicLabRole)role); 80 80 db.SubmitChanges(); … … 186 186 [TestMethod()] 187 187 public void CreateRoleTest() { 188 HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value 189 string roleName = string.Empty; // TODO: Initialize to an appropriate value 190 target.CreateRole(roleName); 191 Assert.Inconclusive("A method that does not return a value cannot be verified."); 188 HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); 189 target.CreateRole("role1"); 190 target.CreateRole("role2"); 191 target.CreateRole("role3", true); 192 Assert.IsTrue(db.HeuristicLabRole.Count(r => r.RoleName == "role1" && r.IsPermission == false) == 1); 193 Assert.IsTrue(db.HeuristicLabRole.Count(r => r.RoleName == "role2" && r.IsPermission == false) == 1); 194 Assert.IsTrue(db.HeuristicLabRole.Count(r => r.RoleName == "role3" && r.IsPermission == true) == 1); 192 195 } 193 196 … … 210 213 public void HeuristicLabRoleProviderConstructorTest() { 211 214 HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); 212 Assert.I nconclusive("TODO: Implement code to verify target");215 Assert.IsNotNull(target); 213 216 } 214 217 }
Note: See TracChangeset
for help on using the changeset viewer.