예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }