Esempio n. 1
0
 public void EngineAvailable_IBusNotRunning_ReturnsFalse()
 {
     using (var e = new IBusEnvironmentForTest(true, false))
     {
         Assert.IsFalse(IBusAdaptor.EngineAvailable);
     }
 }
Esempio n. 2
0
 public void EngineAvailable_ReturnsTrue()
 {
     using (var e = new IBusEnvironmentForTest(true, true))
     {
         Assert.IsTrue(IBusAdaptor.EngineAvailable);
     }
 }
Esempio n. 3
0
 public void ActivateKeyBoard_IBusNotRunning_ThrowsProblemNotificationSentToUser()
 {
     using (var e = new IBusEnvironmentForTest(true, false))
     {
         Assert.Throws <ErrorReport.ProblemNotificationSentToUserException>(
             () => IBusAdaptor.ActivateKeyboard(IBusEnvironmentForTest.OtherKeyboard)
             );
     }
 }
Esempio n. 4
0
 public void Deactivate_IBusNotRunning_DoesNotThrow()
 {
     using (var e = new IBusEnvironmentForTest(true, false))
     {
         Assert.DoesNotThrow(
             () => IBusAdaptor.Deactivate()
             );
     }
 }
Esempio n. 5
0
 public void KeyboardDescriptors_IBusNotRunning_DoesNotThrow()
 {
     using (var e = new IBusEnvironmentForTest(true, false))
     {
         Assert.DoesNotThrow(
             () => { var keyboards = IBusAdaptor.KeyboardDescriptors; }
             );
     }
 }
Esempio n. 6
0
 public void OpenConnection_IBusNotRunning_ThrowsProblemNotificationSentToUser()
 {
     using (var e = new IBusEnvironmentForTest(true, false))
     {
         Assert.Throws <ErrorReport.ProblemNotificationSentToUserException>(
             () => IBusAdaptor.OpenConnection()
             );
     }
 }
Esempio n. 7
0
 public void ActivateKeyBoard_IBusDoesNotHaveKeyboard_Throws()
 {
     using (var e = new IBusEnvironmentForTest(true, true))
     {
         Assert.Throws <ArgumentOutOfRangeException>(
             () => IBusAdaptor.ActivateKeyboard("Nonexistent Keyboard")
             );
     }
 }
Esempio n. 8
0
 public void ActivateKeyBoard_IBusHasKeyboard_GetCurrentKeyboardReturnsActivatedKeyboard()
 {
     using (var e = new IBusEnvironmentForTest(true, true))
     {
         IBusAdaptor.ActivateKeyboard(IBusEnvironmentForTest.OtherKeyboard);
         string actual = IBusAdaptor.GetActiveKeyboard();
         Assert.AreEqual(IBusEnvironmentForTest.OtherKeyboard, actual);
     }
 }
Esempio n. 9
0
 // This will fail because Deactivate does nothing
 public void Deactivate_SwitchesBackToDefaultKeyboard()
 {
     using (var e = new IBusEnvironmentForTest(true, true))
     {
         IBusAdaptor.ActivateKeyboard(IBusEnvironmentForTest.OtherKeyboard);
         IBusAdaptor.Deactivate();
         string actual = IBusAdaptor.GetActiveKeyboard();
         Assert.AreEqual(IBusEnvironmentForTest.DefaultKeyboard, actual);
     }
 }
Esempio n. 10
0
 public void KeyboardDescriptors_ListAllKeyboards()
 {
     using (var e = new IBusEnvironmentForTest(true, true))
     {
         Console.WriteLine("ListAllKeyboards");
         foreach (var keyboard in IBusAdaptor.KeyboardDescriptors)
         {
             Console.WriteLine("Name {0}, Id {1}", keyboard.ShortName, keyboard.Id);
         }
     }
 }