public void ControlModifier()
        {
            ISendKeysParser parser = new SendKeysParser("a^bc");

            Assert.Equal(3, parser.Groups.Length);

            int groupIndex = 0;
            AssertGroup(parser.Groups[groupIndex++], "", "a");
            AssertGroup(parser.Groups[groupIndex++], "^", "b");
            AssertGroup(parser.Groups[groupIndex], "", "c");
        }
        public void GroupExtraction()
        {
            ISendKeysParser parser = new SendKeysParser("111+(aaa)22+^(bbb)33{{}4%(a)");

            Assert.Equal(8, parser.Groups.Length);

            int groupIndex = 0;
            AssertGroup(parser.Groups[groupIndex++], "", "111");
            AssertGroup(parser.Groups[groupIndex++], "+", "aaa");
            AssertGroup(parser.Groups[groupIndex++], "", "22");
            AssertGroup(parser.Groups[groupIndex++], "+^", "bbb");
            AssertGroup(parser.Groups[groupIndex++], "", "33");
            AssertGroup(parser.Groups[groupIndex++], "", "{");
            AssertGroup(parser.Groups[groupIndex++], "", "4");
            AssertGroup(parser.Groups[groupIndex], "%", "a");
        }
        private static void AssertKeywordIsParsedAs(string keyword, VirtualKeyCodes expectedKey)
        {
            ISendKeysParser parser = new SendKeysParser(keyword);

            Assert.Equal(1, parser.Groups.Length);

            Assert.Equal("", parser.Groups[0].ModifierCharacters);
            Assert.Equal(expectedKey, parser.Groups[0].EscapedKey);
            Assert.Equal("", parser.Groups[0].Body);
        }
        public void Key_FunctionKeys()
        {
            ISendKeysParser parser = new SendKeysParser("{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{F13}{F14}{F15}{F16}");

            Assert.Equal(16, parser.Groups.Length);

            int groupIndex = 0;
            Assert.Equal(VirtualKeyCodes.F1, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F2, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F3, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F4, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F5, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F6, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F7, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F8, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F9, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F10, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F11, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F12, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F13, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F14, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F15, parser.Groups[groupIndex++].EscapedKey);
            Assert.Equal(VirtualKeyCodes.F16, parser.Groups[groupIndex].EscapedKey);

            foreach(SendKeysParserGroup group in parser.Groups)
            {
                Assert.Equal(string.Empty, group.ModifierCharacters);
                Assert.Equal(string.Empty, group.Body);
            }
        }