Ejemplo n.º 1
0
 public void EngineAvailable_IBusNotRunning_ReturnsFalse()
 {
     using (var e = new IBusEnvironmentForTest(true, false))
     {
         Assert.IsFalse(IBusAdaptor.EngineAvailable);
     }
 }
Ejemplo n.º 2
0
 public void EngineAvailable_ReturnsTrue()
 {
     using (var e = new IBusEnvironmentForTest(true, true))
     {
         Assert.IsTrue(IBusAdaptor.EngineAvailable);
     }
 }
		public void EngineAvailable_IBusNotRunning_ReturnsFalse()
		{
			using (var e = new IBusEnvironmentForTest(true, false))
			{
				Assert.IsFalse(IBusAdaptor.EngineAvailable);
			}
		}
		public void EngineAvailable_ReturnsTrue()
		{
			using (var e = new IBusEnvironmentForTest(true, true))
			{
				Assert.IsTrue(IBusAdaptor.EngineAvailable);
			}
		}
Ejemplo n.º 5
0
 public void Deactivate_IBusNotRunning_DoesNotThrow()
 {
     using (var e = new IBusEnvironmentForTest(true, false))
     {
         Assert.DoesNotThrow(
             () => IBusAdaptor.Deactivate()
             );
     }
 }
Ejemplo n.º 6
0
 public void KeyboardDescriptors_IBusNotRunning_DoesNotThrow()
 {
     using (var e = new IBusEnvironmentForTest(true, false))
     {
         Assert.DoesNotThrow(
             () => { var keyboards = IBusAdaptor.KeyboardDescriptors; }
             );
     }
 }
Ejemplo n.º 7
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);
     }
 }
		public void ActivateKeyBoard_IBusNotRunning_ThrowsProblemNotificationSentToUser()
		{
			using (var e = new IBusEnvironmentForTest(true, false))
			{
				Assert.Throws<ErrorReport.ProblemNotificationSentToUserException>(
					() => IBusAdaptor.ActivateKeyboard(IBusEnvironmentForTest.OtherKeyboard)
				);
			}
		}
		public void Deactivate_IBusNotRunning_DoesNotThrow()
		{
			using (var e = new IBusEnvironmentForTest(true, false))
			{
				Assert.DoesNotThrow(
					() => IBusAdaptor.Deactivate()
				);
			}
		}
		public void KeyboardDescriptors_IBusNotRunning_DoesNotThrow()
		{
			using (var e = new IBusEnvironmentForTest(true, false))
			{
				Assert.DoesNotThrow(
					() => { var keyboards = IBusAdaptor.KeyboardDescriptors; }
				);
			}
		}
		public void OpenConnection_IBusNotRunning_ThrowsProblemNotificationSentToUser()
		{
			using (var e = new IBusEnvironmentForTest(true, false))
			{
				Assert.Throws<ErrorReport.ProblemNotificationSentToUserException>(
					() => IBusAdaptor.OpenConnection()
				);
			}
		}
Ejemplo n.º 12
0
 public void ActivateKeyBoard_IBusDoesNotHaveKeyboard_Throws()
 {
     using (var e = new IBusEnvironmentForTest(true, true))
     {
         Assert.Throws <ArgumentOutOfRangeException>(
             () => IBusAdaptor.ActivateKeyboard("Nonexistent Keyboard")
             );
     }
 }
Ejemplo n.º 13
0
 public void ActivateKeyBoard_IBusNotRunning_ThrowsProblemNotificationSentToUser()
 {
     using (var e = new IBusEnvironmentForTest(true, false))
     {
         Assert.Throws <ErrorReport.ProblemNotificationSentToUserException>(
             () => IBusAdaptor.ActivateKeyboard(IBusEnvironmentForTest.OtherKeyboard)
             );
     }
 }
Ejemplo n.º 14
0
 public void OpenConnection_IBusNotRunning_ThrowsProblemNotificationSentToUser()
 {
     using (var e = new IBusEnvironmentForTest(true, false))
     {
         Assert.Throws <ErrorReport.ProblemNotificationSentToUserException>(
             () => IBusAdaptor.OpenConnection()
             );
     }
 }
Ejemplo n.º 15
0
		public void ActivateKeyBoard_IBusDoesNotHaveKeyboard_Throws()
		{
			using (var e = new IBusEnvironmentForTest(true, true))
			{
				Assert.Throws<ArgumentOutOfRangeException>(
					() => IBusAdaptor.ActivateKeyboard("Nonexistent Keyboard")
					);
			}
		}
Ejemplo n.º 16
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);
			}
		}
Ejemplo n.º 17
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);
     }
 }
Ejemplo n.º 18
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);
			}
		}
Ejemplo n.º 19
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);
				}
			}
		}
Ejemplo n.º 20
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);
         }
     }
 }