示例#1
0
 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();
 }
示例#2
0
 public void Should_Call_LockNow()
 {
     LockScreenManager.Use(_lockWorkStationStrategy.Object, m => m.LockNow());
     _lockWorkStationStrategy.Verify(x => x.Lock(), Times.Once());
 }
示例#3
0
 public void Should_throw_Exception()
 {
     Assert.ThrowsException <NullReferenceException>(() => LockScreenManager.Use(null, m => m.LockNow()));
     _lockWorkStationStrategy.Verify(x => x.Lock(), Times.Never());
 }