public void CheckDefaultTokenLifeTimeIsPositiveNumber() { logger.Info("CheckDefaultTokenLifeTimeIsPositiveNumber test started"); Lifetime lifetime = guestService.GetCurrentTokenLifetime(); int tokenLifeTimeValue; bool actualResult = Int32.TryParse(lifetime.Time, out tokenLifeTimeValue); logger.Info(" actualResult : {0}", actualResult); logger.Info(" tokenLifeTimeValue : {0}", tokenLifeTimeValue); Assert.IsTrue(actualResult); Assert.IsTrue(tokenLifeTimeValue > 0); logger.Info("CheckDefaultTokenLifeTimeIsPositiveNumber test started"); }
public void ExamineTime(IUser adminUser, Lifetime newTokenlifetime) { Console.WriteLine("*** adminUser: "******"Current Time Error"); AdminService adminService = guestService .SuccessfulAdminLogin(adminUser); adminService = adminService.UpdateTokenlifetime(newTokenlifetime); currentTokenlifetime = adminService.GetCurrentTokenLifetime(); Assert.AreEqual(LifetimeRepository.LONG_TOKEN_LIFETIME, currentTokenlifetime.Time, "Long Time Error"); guestService = adminService.Logout(); Assert.IsEmpty(adminUser.Token, "Logout Error"); // TODO currentTokenlifetime.Time = LifetimeRepository.DEFAULT_TOKEN_LIFETIME; adminService = guestService.SuccessfulAdminLogin(adminUser); adminService = adminService.UpdateTokenlifetime(currentTokenlifetime); guestService = adminService.Logout(); currentTokenlifetime = guestService.GetCurrentTokenLifetime(); Assert.AreEqual(LifetimeRepository.DEFAULT_TOKEN_LIFETIME, currentTokenlifetime.Time, "Current Time Error"); }