예제 #1
0
        public void SetRotorsEnforcesReflector()
        {
            EnigmaI enigma = new EnigmaI();

            EnigmaRotor[] rotors = new EnigmaRotor[4];
            enigma.SetRotors(rotors);
        }
예제 #2
0
        public void CanSetRotors()
        {
            EnigmaI enigma = new EnigmaI();

            EnigmaRotor[] rotors = new EnigmaRotor[4];
            rotors[0] = new EnigmaReflector();
            enigma.SetRotors(rotors);
        }
예제 #3
0
        public void SetRotorsEnforcesRotorCount()
        {
            EnigmaI enigma = new EnigmaI();

            EnigmaRotor[] rotors = new EnigmaRotor[3];
            rotors[0] = new EnigmaReflector();
            enigma.SetRotors(rotors);
        }
예제 #4
0
        public ISteckeredEnigma GetEnigmaI(Reflector reflector, Rotor[] rotors)
        {
            EnforceEnigmaIRotorConstraints(rotors);
            EnforceEnigmaIReflectorConstraints(reflector);

            EnigmaRotor[] allRotors = MergeReflectorIntoRotorArray(reflector, rotors);
            //allRotors[1] = _rotorFactory.GetRotor(rotors[0]);
            //allRotors[2] = _rotorFactory.GetRotor(rotors[1]);
            //allRotors[3] = _rotorFactory.GetRotor(rotors[2]);
            EnigmaI returnValue = new EnigmaI();

            returnValue.SetRotors(allRotors);
            return(returnValue);
        }