Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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();
        }