private static void LockScreen() { if (!PositionsIsFull()) { return; } Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Locked"); Console.ResetColor(); LockScreenManager.Use(new WindowsUser32LockStationStrategy(), m => m.LockNow()); LastPositions.Clear(); }
public void Should_Call_LockNow() { LockScreenManager.Use(_lockWorkStationStrategy.Object, m => m.LockNow()); _lockWorkStationStrategy.Verify(x => x.Lock(), Times.Once()); }
public void Should_throw_Exception() { Assert.ThrowsException <NullReferenceException>(() => LockScreenManager.Use(null, m => m.LockNow())); _lockWorkStationStrategy.Verify(x => x.Lock(), Times.Never()); }