public void Substitution_cipher_can_wrap_on_decode() { var sut = new SimpleCipher("abcdefghij"); Assert.Equal("zzzzzzzzzz", sut.Decode("zabcdefghi")); }
public void Random_key_cipher_can_decode() { var sut = new SimpleCipher(); Assert.Equal("aaaaaaaaaa", sut.Decode(sut.Key.Substring(0, 10))); }
public void Substitution_cipher_is_reversible_i_e_if_you_apply_decode_in_a_encoded_result_you_must_see_the_same_plaintext_encode_parameter_as_a_result_of_the_decode_method() { var sut = new SimpleCipher("abcdefghij"); Assert.Equal("abcdefghij", sut.Decode(sut.Encode("abcdefghij"))); }
public void Substitution_cipher_can_decode_messages_longer_than_the_key() { var sut = new SimpleCipher("abc"); Assert.Equal("iamapandabear", sut.Decode("iboaqcnecbfcr")); }