- Timestamp:
- 06/25/10 17:42:10 (14 years ago)
- Location:
- branches/HeuristicLab.Services.Authentication Prototype/UnitTests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.