public void CommandKeyGestureAttributeConstructorTest6() { const Key key = Key.D; const ModifierKeys modifiers = ModifierKeys.Alt | ModifierKeys.Shift; const string target1 = "MyTarget"; var target = new CommandKeyGestureAttribute(key, modifiers, target1); Assert.AreEqual(key, target.Key.Key); Assert.AreEqual(modifiers, target.Key.Modifiers); Assert.AreEqual(string.Empty, target.Key.DisplayString); Assert.AreEqual(target1, target.Target); }
public void CommandKeyGestureAttributeConstructorTest5() { var key = new KeyGesture(Key.F1); var target = new CommandKeyGestureAttribute(key); Assert.AreEqual(key, target.Key); Assert.AreEqual(string.Empty, target.Key.DisplayString); Assert.IsNull(target.Target); Assert.Throws<ArgumentNullException>(() => target = new CommandKeyGestureAttribute(null)); }
public void CommandKeyGestureAttributeConstructorTest3() { const Key key = Key.A; const ModifierKeys modifiers = ModifierKeys.Alt; var target = new CommandKeyGestureAttribute(key, modifiers); Assert.AreEqual(key, target.Key.Key); Assert.AreEqual(modifiers, target.Key.Modifiers); Assert.AreEqual(string.Empty, target.Key.DisplayString); Assert.IsNull(target.Target); }
public void CommandKeyGestureAttributeConstructorTest4() { const Key key = Key.F1; const string target1 = "TestTarget"; var target = new CommandKeyGestureAttribute(key, target1); Assert.AreEqual(key, target.Key.Key); Assert.AreEqual(ModifierKeys.None, target.Key.Modifiers); Assert.AreEqual(string.Empty, target.Key.DisplayString); Assert.AreEqual(target1, target.Target); Assert.Throws<ArgumentNullException>(() => target = new CommandKeyGestureAttribute(null, target1)); }
public void CommandKeyGestureAttributeConstructorTest2() { const Key key = Key.F1; var target = new CommandKeyGestureAttribute(key); Assert.AreEqual(key, target.Key.Key); Assert.AreEqual(ModifierKeys.None, target.Key.Modifiers); Assert.AreEqual(string.Empty, target.Key.DisplayString); Assert.IsNull(target.Target); }