public void GivenSingleKeyIsStringThenSelectionResultEventHandlerShouldBeAttachedToInputService() { var points = new List <Point>(); var selection = new Tuple <List <Point>, KeyValue, List <string> >( points, new KeyValue("SingleKeyValueIsString"), new List <string>()); InputService.Raise(s => s.SelectionResult += null, this, selection); Assert.AreEqual(points, MainViewModel.SelectionResultPoints); KeyboardOutputService.Verify(s => s.ProcessSingleKeyText("SingleKeyValueIsString"), Times.Once()); }
public void GivenMultiKeySelectionThenSelectionResultEventHandlerShouldBeAttachedToInputService() { var points = new List<Point>(); var multiKeySelection = new List<string> { "test-multi" }; var selection = new Tuple<List<Point>, FunctionKeys?, string, List<string>>( points, null, null, multiKeySelection); InputService.Raise(s => s.SelectionResult += null, this, selection); Assert.AreEqual(points, MainViewModel.SelectionResultPoints); KeyboardOutputService.Verify(s => s.ProcessMultiKeyTextAndSuggestions(multiKeySelection), Times.Once()); }
public void GivenSingleKeyIsFunctionKeySelectionResultEventHandlerShouldBeAttachedToInputService() { var points = new List <Point>(); var selection = new Tuple <List <Point>, KeyValue, List <string> >( points, new KeyValue(FunctionKeys.Suggestion1), new List <string>()); InputService.Raise(s => s.SelectionResult += null, this, selection); Assert.AreEqual(points, MainViewModel.SelectionResultPoints); KeyStateService.Verify(s => s.ProgressKeyDownState(It.IsAny <KeyValue>()), Times.Once()); //TODO: validate 101 function key cases of MainViewModel.HandleFunctionKeySelectionResult KeyboardOutputService.Verify(s => s.ProcessFunctionKey(It.IsAny <FunctionKeys>()), Times.Once()); }