예제 #1
0
 public void BecauseOf()
 {
     _enigmaMachine = new Mock<IEnigmaMachine>();
     _enigmaEncoder = new EnigmaEncoder(_enigmaMachine.Object);
     _enigmaMachine.Setup(x => x.Convert('A')).Returns('X');
     _enigmaMachine.Setup(x => x.Convert('B')).Returns('Y');
     _enigmaMachine.Setup(x => x.Convert('C')).Returns('Z');
     _output = _enigmaEncoder.Encode("abc");
 }
예제 #2
0
 public void BecauseOf()
 {
     var enigmaEncoder = new EnigmaEncoder(new EnigmaMachine(new[] {1, 2, 3}, new[] {'M', 'C', 'K'}));
     _output = enigmaEncoder.Encode("QMJIDOMZWZJFJR");
 }