示例#1
0
        public void TestKeyEquality()
        {
            Key key1 = new Key("C-a");
            Key key2 = new Key("C-f10");
            Key key3 = new Key("C-f10");

            Assert.AreNotEqual(key1, key2);
            Assert.AreEqual(key2, key3);
        }
示例#2
0
        public void TestKeyConstructor()
        {
            Key key = new Key("A", false, true, false);
            Assert.AreEqual("A", key.KeyCode);
            Assert.AreEqual(false, key.Shift);
            Assert.AreEqual(true, key.Control);
            Assert.AreEqual(false, key.Alt);

            Key key2 = new Key("C-a");
            Assert.AreEqual(key, key2);
        }
示例#3
0
 public KeyStrokeEventArgs(Key key)
 {
     _key = key;
 }
示例#4
0
 public void TestKeyToString()
 {
     Key key = new Key("C-a");
     Assert.AreEqual("C-a", key.ToString());
 }