public void UpdateLogin() { Login login = new Login() { Active = true, Email = "*****@*****.**", FirstName = "Jacobo", LastName = "Marcos Perchin", UserLogin = "******", Password = "******", PasswordExpirationDate = DateTime.UtcNow.AddMonths(6) }; login = this.BasicRepository.Save(login); ThreadIdentity.SetCurrentThreadIdentity("Update Test Identity"); login.Email = "*****@*****.**"; login.Password = "******"; login.PasswordExpirationDate = DateTime.UtcNow.AddMonths(12); DateTime beforeUpdate = DateTime.UtcNow; BasicRepository.Update(login); Login loginUpdated = RefreshEntityFromDatabase(login.Id.Value); Assert.AreEqual(login.Active, loginUpdated.Active); Assert.AreEqual(login.Email, loginUpdated.Email); Assert.AreEqual(login.FirstName, loginUpdated.FirstName); Assert.AreEqual(login.LastName, loginUpdated.LastName); Assert.AreEqual(login.UserLogin, loginUpdated.UserLogin); Assert.AreEqual(login.Password, loginUpdated.Password); Assert.AreEqual(login.PasswordExpirationDate, loginUpdated.PasswordExpirationDate); VerifyAuditInfoAfterUpdate(loginUpdated, beforeUpdate, "Update Test Identity"); }
public void Init() { SchemaGeneration.GenerateDatabase(); TimeOnTestSetup = DateTime.UtcNow; ThreadIdentity.SetCurrentThreadIdentity("Test Identity"); SessionFactory.GetCurrentSession().BeginTransaction(); }
static void AnotherThread (object o) { Thread t = Thread.CurrentThread; ThreadIdentity i; i = new ThreadIdentity (t.GetHashCode (), t.ManagedThreadId); lock (_threads) { _threads.Add (i); } }
public void DeleteLogin() { Login login = new Login() { Active = true, Email = "*****@*****.**", FirstName = "Jacobo", LastName = "Marcos Perchin", UserLogin = "******", Password = "******", PasswordExpirationDate = DateTime.UtcNow.AddMonths(6) }; login = this.BasicRepository.Save(login); ThreadIdentity.SetCurrentThreadIdentity("Delete Test Identity"); DateTime beforeUpdate = DateTime.UtcNow; BasicRepository.Delete(login); Login loginDeleted = RefreshEntityFromDatabase(login.Id.Value); VerifyAuditInfoAfterDelete(loginDeleted, beforeUpdate, "Delete Test Identity"); }
protected override void OnSetUp() { base.OnSetUp(); SchemaGeneration.GenerateDatabase(); ThreadIdentity.SetCurrentThreadIdentity("Test Identity"); }