예제 #1
0
        public void TestConvert()
        {
            var member = Reflector.Convert(() => (long)default(Fixnum));

            Assert.That(member, Is.Not.Null);
            Assert.That(member, Is.InstanceOf(typeof(MethodInfo)));
        }
예제 #2
0
        /// <summary>
        /// Simulates key press.
        /// </summary>
        /// <param name="value">Decimal value of pressed key.</param>
        /// <returns>Converted value in decimal mode.</returns>
        public int Convert(int value)
        {
            AdvanceRotors();
            var res = value;

            res = _plugboard.Convert(res);
            res = _right.Convert(res);
            res = _center.Convert(res);
            res = _left.Convert(res);
            res = _reflector.Convert(res);
            res = _left.ConvertInv(res);
            res = _center.ConvertInv(res);
            res = _right.ConvertInv(res);
            res = _plugboard.Convert(res);
            return(res);
        }