Index: /branches/HeuristicLab.Services.Authentication Prototype/HeuristicLab.Services.Authentication Prototyp.vsmdi
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/HeuristicLab.Services.Authentication Prototyp.vsmdi (revision 3948)
+++ /branches/HeuristicLab.Services.Authentication Prototype/HeuristicLab.Services.Authentication Prototyp.vsmdi (revision 3949)
@@ -1,24 +1,25 @@
-
- just first test for HeuristicLabUser
+
+
+
+
+
+
+
-
-
-
-
+
+
+
-
-
-
Index: /branches/HeuristicLab.Services.Authentication Prototype/UnitTests/AbstractHeuristicLabTest.cs
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/UnitTests/AbstractHeuristicLabTest.cs (revision 3948)
+++ /branches/HeuristicLab.Services.Authentication Prototype/UnitTests/AbstractHeuristicLabTest.cs (revision 3949)
@@ -22,27 +22,25 @@
///
- /// creates and opens a local database our of the DataClasses
+ /// creates and opens a local database out of the DataClasses and checks connection state
///
- [TestMethod()]
- public virtual void createDBTest() {
+ [TestInitialize()]
+ public virtual void updateDBConnection() {
Assert.IsNotNull(db);
-
DatabaseUtil.createDatabase(db);
-
+ if (db.Connection.State != System.Data.ConnectionState.Open) {
+ db.Connection.Open();
+ }
Assert.AreEqual(System.Data.ConnectionState.Open, db.Connection.State);
}
///
- /// checks if the database connection is open
- /// should be used by all other test methods
+ /// closes db connection
///
- protected virtual void checkConnection() {
- Assert.IsNotNull(db);
-
- if (db.Connection.State != System.Data.ConnectionState.Open) {
- db.Connection.Open();
+ [TestCleanup()]
+ public virtual void closeDBConnection() {
+ if (db.Connection.State == System.Data.ConnectionState.Open) {
+ db.Connection.Close();
}
-
- Assert.AreEqual(System.Data.ConnectionState.Open, db.Connection.State);
+ Assert.AreEqual(System.Data.ConnectionState.Closed, db.Connection.State);
}
}
Index: /branches/HeuristicLab.Services.Authentication Prototype/UnitTests/HeuristicLabUserTest.cs
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/UnitTests/HeuristicLabUserTest.cs (revision 3948)
+++ /branches/HeuristicLab.Services.Authentication Prototype/UnitTests/HeuristicLabUserTest.cs (revision 3949)
@@ -19,6 +19,4 @@
[TestMethod()]
public void modifyUserTest() {
- checkConnection();
-
// insert new user
Persistence.HeuristicLabUser user = new HeuristicLabUser("testname", "testemail", "testquestion", "testcomment");
@@ -220,5 +218,5 @@
Assert.AreEqual("pwd1", target.GetPassword());
target.ResetPassword();
- Assert.AreEqual("", target.GetPassword());
+ Assert.AreEqual("INIT", target.GetPassword());
}
@@ -242,5 +240,5 @@
HeuristicLabUser target = new HeuristicLabUser("testname", "testemail", "testquestion", "testcomment");
target.PasswordAnswer = "answer";
- Assert.AreEqual("", target.GetPassword("answer"));
+ Assert.AreEqual("INIT", target.GetPassword("answer"));
target.ChangePassword(target.Password, "pwd1");
Assert.AreEqual("pwd1", target.GetPassword("answer"));