- Timestamp:
- 06/25/10 17:42:10 (14 years ago)
- Location:
- branches/HeuristicLab.Services.Authentication Prototype
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Services.Authentication Prototype/HeuristicLab.Services.Authentication Prototyp.vsmdi
r3943 r3949 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2006"> 3 <TestList name="HeuristicLabUserTestList" id="1ebca506-0e3e-4cc3-800e-9905f9a66bd2" parentListId="8c43106b-9dc1-4907-a29f-aa66a61bf5b6"> 4 <Description>just first test for HeuristicLabUser</Description> 3 <TestList name="Testlisten" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6"> 4 <RunConfiguration id="3cde0e70-9e75-4b76-a987-9e1d702958f0" name="Lokaler Testlauf" storage="localtestrun.testrunconfig" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, PublicKeyToken=b03f5f7f11d50a3a" /> 5 </TestList> 6 <TestList name="HeuristicLabUserTestList" id="8c8759cd-2720-49fa-8e40-35ae89286ea1" parentListId="8c43106b-9dc1-4907-a29f-aa66a61bf5b6"> 5 7 <TestLinks> 8 <TestLink id="c94ce8a9-0db1-d5f7-0d29-a5b40ed93b8f" name="ChangePasswordTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 9 <TestLink id="ecaca427-086c-9493-06af-9887f2d8184f" name="PasswordAnswerTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 10 <TestLink id="760cee90-ae54-277d-b10b-28dcbd0d3e2b" name="ResetPasswordTest1" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 6 11 <TestLink id="537e2ce5-1968-64c1-932a-0aff7f0ea564" name="ToStringTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 7 <TestLink id="ecaca427-086c-9493-06af-9887f2d8184f" name="PasswordAnswerTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" />8 <TestLink id="c94ce8a9-0db1-d5f7-0d29-a5b40ed93b8f" name="ChangePasswordTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" />9 <TestLink id="5c113ee8-ae71-cf76-5bf1-608203739eeb" name="HeuristicLabUserConstructorTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" />10 12 <TestLink id="b6e6a789-8f4e-329c-38ef-d9e19bd14e55" name="PasswordTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 11 <TestLink id="def90666-533d-bda5-8a29-fde7f290333f" name="createDBTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" />12 13 <TestLink id="4452b5de-b1d7-2a87-17cf-5bcef24a98ba" name="modifyUserTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 14 <TestLink id="e0e05989-bce3-7e2f-d85f-30efe28be806" name="GetPasswordTest1" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 13 15 <TestLink id="ce8163d5-a5c1-2a43-04b4-3afe6a0140c3" name="ChangePasswordQuestionAndAnswerTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 14 16 <TestLink id="5a5bdb37-43b0-c6f1-1b5b-7df4fecd3b8f" name="PasswordQuestionTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 17 <TestLink id="ce5df924-ff5f-962d-94e4-cbd375c40951" name="ResetPasswordTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 15 18 <TestLink id="799ee04a-e351-af4d-61c5-344e29aaace3" name="UserNameTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 16 19 <TestLink id="23131c03-ebe9-6d64-7d73-52214a9dac7d" name="EmailTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 20 <TestLink id="d2c8a683-ac68-bded-8e0e-22e2473daa15" name="GetPasswordTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 17 21 <TestLink id="e3413b57-3027-8e7d-3f25-67842a5c6986" name="CommentTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 18 22 <TestLink id="2b5d5229-e68f-6a88-fb76-73fa5d493613" name="LastPasswordChangedDateTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" /> 19 23 </TestLinks> 20 24 </TestList> 21 <TestList name="Testlisten" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">22 <RunConfiguration id="3cde0e70-9e75-4b76-a987-9e1d702958f0" name="Lokaler Testlauf" storage="localtestrun.testrunconfig" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, PublicKeyToken=b03f5f7f11d50a3a" />23 </TestList>24 25 </TestLists> -
branches/HeuristicLab.Services.Authentication Prototype/UnitTests/AbstractHeuristicLabTest.cs
r3943 r3949 22 22 23 23 /// <summary> 24 /// creates and opens a local database ou r of the DataClasses24 /// creates and opens a local database out of the DataClasses and checks connection state 25 25 /// </summary> 26 [Test Method()]27 public virtual void createDBTest() {26 [TestInitialize()] 27 public virtual void updateDBConnection() { 28 28 Assert.IsNotNull(db); 29 30 29 DatabaseUtil.createDatabase(db); 31 30 if (db.Connection.State != System.Data.ConnectionState.Open) { 31 db.Connection.Open(); 32 } 32 33 Assert.AreEqual<System.Data.ConnectionState>(System.Data.ConnectionState.Open, db.Connection.State); 33 34 } 34 35 35 36 /// <summary> 36 /// checks if the database connection is open 37 /// should be used by all other test methods 37 /// closes db connection 38 38 /// </summary> 39 protected virtual void checkConnection() { 40 Assert.IsNotNull(db); 41 42 if (db.Connection.State != System.Data.ConnectionState.Open) { 43 db.Connection.Open(); 39 [TestCleanup()] 40 public virtual void closeDBConnection() { 41 if (db.Connection.State == System.Data.ConnectionState.Open) { 42 db.Connection.Close(); 44 43 } 45 46 Assert.AreEqual<System.Data.ConnectionState>(System.Data.ConnectionState.Open, db.Connection.State); 44 Assert.AreEqual<System.Data.ConnectionState>(System.Data.ConnectionState.Closed, db.Connection.State); 47 45 } 48 46 } -
branches/HeuristicLab.Services.Authentication Prototype/UnitTests/HeuristicLabUserTest.cs
r3943 r3949 19 19 [TestMethod()] 20 20 public void modifyUserTest() { 21 checkConnection();22 23 21 // insert new user 24 22 Persistence.HeuristicLabUser user = new HeuristicLabUser("testname", "testemail", "testquestion", "testcomment"); … … 220 218 Assert.AreEqual<String>("pwd1", target.GetPassword()); 221 219 target.ResetPassword(); 222 Assert.AreEqual<String>(" ", target.GetPassword());220 Assert.AreEqual<String>("INIT", target.GetPassword()); 223 221 } 224 222 … … 242 240 HeuristicLabUser target = new HeuristicLabUser("testname", "testemail", "testquestion", "testcomment"); 243 241 target.PasswordAnswer = "answer"; 244 Assert.AreEqual<String>(" ", target.GetPassword("answer"));242 Assert.AreEqual<String>("INIT", target.GetPassword("answer")); 245 243 target.ChangePassword(target.Password, "pwd1"); 246 244 Assert.AreEqual<String>("pwd1", target.GetPassword("answer"));
Note: See TracChangeset
for help on using the changeset viewer.