public void TestRotorOffsets()
        {
            var socket = new RotorSocket(Rotor.Create("I"));

            Assert.AreEqual('A', socket.CurrentRingLetter);
            socket.Advance();
            Assert.AreEqual('B', socket.CurrentRingLetter);
            socket.Reset();
            Assert.AreEqual('A', socket.CurrentRingLetter);
            for (int i = 0; i < 26; i++)
            {
                socket.Advance();
            }
            Assert.AreEqual('A', socket.CurrentRingLetter);
        }
示例#2
0
 public void ResetRotors()
 {
     _fastRotor   = _fastRotor.Reset();
     _middleRotor = _middleRotor.Reset();
     _slowRotor   = _slowRotor.Reset();
 }