Exemplo n.º 1
0
        public void SymbolicKeysTranslatorConstructorTest()
        {
            var builder   = new FakeProcessorsBuilder(new[] { new SymbolicKeysTranslator() });
            var converter = new NaturalTextConverter(builder);
            var events    = new [] { KeyboardEvent.FromKeys(Keys.Enter), KeyboardEvent.FromKeys(Keys.Escape) };

            var actual = converter.Convert(events, null, null, null);

            Assert.AreEqual("\u21b5\u238b", actual);
        }
        public void SymbolicKeysTranslatorConstructorTest()
        {
            var builder = new FakeProcessorsBuilder(new[] { new SymbolicKeysTranslator() });
            var converter = new NaturalTextConverter(builder);
            var events = new [] { KeyboardEvent.FromKeys(Keys.Enter), KeyboardEvent.FromKeys(Keys.Escape) };

            var actual = converter.Convert(events, null, null, null);

            Assert.AreEqual("\u21b5\u238b", actual);
        }
Exemplo n.º 3
0
        public void HidePasswordTest()
        {
            var builder = new FakeProcessorsBuilder(new[] { new PasswordProcessor() });
            var converter = new NaturalTextConverter(builder);
            var events = new[] {
                KeyboardEvent.FromChar('1'), KeyboardEvent.FromChar('a'),
                KeyboardEvent.FromKeys(Keys.Control | Keys.K), KeyboardEvent.FromKeys(Keys.Control | Keys.L),  // password mode shortcut (E)
                KeyboardEvent.FromChar('p'), KeyboardEvent.FromChar('a'), KeyboardEvent.FromChar('s'), KeyboardEvent.FromChar('s'),
                KeyboardEvent.FromKeys(Keys.Control | Keys.K), KeyboardEvent.FromKeys(Keys.Control | Keys.L),  // password mode shortcut (D)
                KeyboardEvent.FromChar('3'), KeyboardEvent.FromChar('7'),
            };

            var actual = converter.Convert(events, null, null, null);

            Assert.AreEqual("****", actual);
        }
Exemplo n.º 4
0
        public void HidePasswordTest()
        {
            var builder   = new FakeProcessorsBuilder(new[] { new PasswordProcessor() });
            var converter = new NaturalTextConverter(builder);
            var events    = new[] {
                KeyboardEvent.FromChar('1'), KeyboardEvent.FromChar('a'),
                KeyboardEvent.FromKeys(Keys.Control | Keys.K), KeyboardEvent.FromKeys(Keys.Control | Keys.L),  // password mode shortcut (E)
                KeyboardEvent.FromChar('p'), KeyboardEvent.FromChar('a'), KeyboardEvent.FromChar('s'), KeyboardEvent.FromChar('s'),
                KeyboardEvent.FromKeys(Keys.Control | Keys.K), KeyboardEvent.FromKeys(Keys.Control | Keys.L),  // password mode shortcut (D)
                KeyboardEvent.FromChar('3'), KeyboardEvent.FromChar('7'),
            };

            var actual = converter.Convert(events, null, null, null);

            Assert.AreEqual("****", actual);
        }
Exemplo n.º 5
0
        public void ShowAllevenPasswordTest()
        {
            var builder   = new FakeProcessorsBuilder(new[] { new CharKeyProcessor() });
            var converter = new NaturalTextConverter(builder);
            var events    = new[] {
                KeyboardEvent.FromChar('1'), KeyboardEvent.FromChar('a'),
                KeyboardEvent.FromKeys(Keys.Control | Keys.K), KeyboardEvent.FromKeys(Keys.Control | Keys.L),
                KeyboardEvent.FromChar('p'), KeyboardEvent.FromChar('a'), KeyboardEvent.FromChar('s'), KeyboardEvent.FromChar('s'),
                KeyboardEvent.FromKeys(Keys.Control | Keys.K), KeyboardEvent.FromKeys(Keys.Control | Keys.L),
                KeyboardEvent.FromChar('3'), KeyboardEvent.FromChar('7'),
            };

            var actual = converter.Convert(events, null, null, null);

            Assert.AreEqual("1apass37", actual);
        }
Exemplo n.º 6
0
        public void ShowAllevenPasswordTest()
        {
            var builder = new FakeProcessorsBuilder(new[] { new CharKeyProcessor() });
            var converter = new NaturalTextConverter(builder);
            var events = new[] {
                KeyboardEvent.FromChar('1'), KeyboardEvent.FromChar('a'),
                KeyboardEvent.FromKeys(Keys.Control | Keys.K), KeyboardEvent.FromKeys(Keys.Control | Keys.L),
                KeyboardEvent.FromChar('p'), KeyboardEvent.FromChar('a'), KeyboardEvent.FromChar('s'), KeyboardEvent.FromChar('s'),
                KeyboardEvent.FromKeys(Keys.Control | Keys.K), KeyboardEvent.FromKeys(Keys.Control | Keys.L),
                KeyboardEvent.FromChar('3'), KeyboardEvent.FromChar('7'),
            };

            var actual = converter.Convert(events, null, null, null);

            Assert.AreEqual("1apass37", actual);
        }