public void RemainingTimeIsChanging() { var windowsLocker = new WindowsLocker(); var locktimer = new Locktimer(windowsLocker); var firstRemainingTime = locktimer.GetRemainingTime(); Thread.Sleep(3000); var secondRemainingTime = locktimer.GetRemainingTime(); Assert.AreNotEqual(firstRemainingTime, secondRemainingTime); }
public void RemainingTimeReturnTimeThatIsNotLargerThanMaxAllowedTime() { LastSessionSynchronizer.SaveSessionData(TimeSpan.FromHours(25)); var windowsLocker = new WindowsLocker(); var locktimer = new Locktimer(windowsLocker); var remainingTime = locktimer.GetRemainingTime(); var maxAllowedTime = Locktimer.GetMaxAllowedTime(); var remainingTimeIsNotLargerThanMaxAllowedTime = remainingTime <= maxAllowedTime; Assert.AreEqual(true, remainingTimeIsNotLargerThanMaxAllowedTime); }
public MainLockerForm() { InitializeComponent(); trayIcon.Icon = new System.Drawing.Icon("App.ico"); _windowsLocker = new WindowsLocker(); _lockTimer = new Locktimer(_windowsLocker); _printRemaingTimeTimer = new Timer(); _printRemaingTimeTimer.Interval = 1000; _printRemaingTimeTimer.Tick += PrintRemaingTime; _printRemaingTimeTimer.Start(); }