private static IbusKeyboardDescription CreateMockIbusKeyboard(IbusKeyboardAdaptor ibusKeyboardAdapter, string name, string language, string layout) { var engineDescMock = new Mock <IBusEngineDesc>(); engineDescMock.Setup(x => x.Name).Returns(name); engineDescMock.Setup(x => x.Language).Returns(language); engineDescMock.Setup(x => x.Layout).Returns(layout); var keyboard = new IbusKeyboardDescription(ibusKeyboardAdapter, engineDescMock.Object); KeyboardController.Manager.RegisterKeyboard(keyboard); return(keyboard); }
private static IbusKeyboardDescription CreateMockIbusKeyboard(IKeyboardSwitchingAdaptor ibusKeyboardAdapter, string name, string language, string layout) { var engineDescMock = new Mock <IBusEngineDesc>(); engineDescMock.Setup(x => x.Name).Returns(name); engineDescMock.Setup(x => x.Language).Returns(language); engineDescMock.Setup(x => x.Layout).Returns(layout); var keyboard = new IbusKeyboardDescription(string.Format("{0}_{1}", language, name), engineDescMock.Object, ibusKeyboardAdapter) { SystemIndex = 3 }; KeyboardController.Instance.Keyboards.Add(keyboard); return(keyboard); }