Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }