public void BookCipherWithNegativeWordIndexThrows() { BookCipher.Decrypt(new int[] { 1, 2, -1 }, TestWords, LetterSelection.FirstLetter, OutOfBoundsIndex.ThrowException); }
public void BookCipherWithWordIndexOutOfRangeAndWrapOnWithModuloZeroWorks() { var result = BookCipher.Decrypt(new int[] { 1, 2, 10, 4, 5 }, TestWords, LetterSelection.FirstLetter, OutOfBoundsIndex.WrapUsingModulo); Assert.AreEqual("fsysy", result, "cipher should be fsysy"); }
public void BookCipherWithEmptyWordThrows() { BookCipher.Decrypt(new int[] { 1, 2 }, new string[] { "1", "" }, LetterSelection.FirstLetter, OutOfBoundsIndex.ThrowException); }
public void BookCipherWithWordIndexOutOfRangeAndNoExceptionsSetWorks() { var result = BookCipher.Decrypt(new int[] { 1, 2, 8 }, TestWords, LetterSelection.FirstLetter, OutOfBoundsIndex.ReturnQMark); Assert.AreEqual("fs?", result, "cipher should be fs?"); }
public void BookCipherWithWordIndexOutOfRangeThrows() { BookCipher.Decrypt(new int[] { 1, 2, 8 }, TestWords, LetterSelection.FirstLetter, OutOfBoundsIndex.ThrowException); }
public void BookCipherWithBadIntFormatStringThrows() { BookCipher.Decrypt(new string[] { "1", "2", "3", "abc" }, TestWords, LetterSelection.FirstLetter, OutOfBoundsIndex.ThrowException); }
public void BookCipherDecryptWithIntAsStringLastLetterIsSuccessful() { var result = BookCipher.Decrypt(new string[] { "1", "2", "3", "4" }, TestWords, LetterSelection.LastLetter, OutOfBoundsIndex.ThrowException); Assert.AreEqual("redn", result, "IntAsString should be redn"); }
public void BookCipherDecryptBasicLastLetterIsSuccessful() { var result = BookCipher.Decrypt(new int[] { 1, 2, 3, 4 }, TestWords, LetterSelection.LastLetter, OutOfBoundsIndex.ThrowException); Assert.AreEqual("redn", result, "cipher last letter should be redn"); }