public void ReadkeyCommandHandlerExecuteShouldThrowForNullCommand() { var readkeyHandler = new ReadkeyCommandHandler(this.keyMapService, this.mainWindow); readkeyHandler.Invoking(t => t.Execute(null)) .ShouldThrow<ArgumentNullException>() .And.ParamName.Should() .Be("command"); }
public async Task ReadkeyCommandHandlerExecuteWaitsForNextKeySequenceOfTopKey() { this.keyMapService.AddKeyMap("dummyKeyMap"); this.keyMapService.SetTopKey("dummyKeyMap", Keys.T); var readkeyHandler = new ReadkeyCommandHandler(this.keyMapService, this.mainWindow); await readkeyHandler.Execute(new ReadkeyCommand { Args = "dummyKeyMap" }); this.mainWindow.Received(1).WaitForNextKeyAsync(Keys.T); }
public void ReadkeyCommandHandlerExecuteShouldThrowForNullKeyMapName() { var readkeyHandler = new ReadkeyCommandHandler(this.keyMapService, this.mainWindow); readkeyHandler.Invoking(t => t.Execute(new ReadkeyCommand())).ShouldThrow<ArgumentException>(); }