public void Does_correct_substitution( string alphabet, char keyChar, char expected, char inputChar ) { var sut = new AlphabetCipher(alphabet); var result = sut.Decode(inputChar, keyChar); Assert.Equal(expected, result); }
public void Should_decode_message_given_keyword() { // Arrange const string expected = "meetmebythetree"; var sut = new AlphabetCipher("scones"); // Act var actual = sut.Decode("egsgqwtahuiljgs"); // Assert Assert.AreEqual(expected, actual); }
static int Main(string[] args) { if (args.Count() < 2) { Console.WriteLine("Usage: decode key input"); return(1); } var key = args[0].ToLower(); var input = args[1].ToLower(); var cipher = new AlphabetCipher(); Console.WriteLine(cipher.Decode(input, key)); return(0); }