public void Substitution_cipher_can_handle_messages_longer_than_the_key() { var sut = new SimpleCipher("abc"); Assert.Equal("iboaqcnecbfcr", sut.Encode("iamapandabear")); }
public void Random_key_cipher_can_encode() { var sut = new SimpleCipher(); Assert.Equal(sut.Key.Substring(0, 10), sut.Encode("aaaaaaaaaa")); }
public void Substitution_cipher_can_double_shift_encode() { var sut = new SimpleCipher("iamapandabear"); Assert.Equal("qayaeaagaciai", sut.Encode("iamapandabear")); }
public void Substitution_cipher_can_wrap_on_encode() { var sut = new SimpleCipher("abcdefghij"); Assert.Equal("zabcdefghi", sut.Encode("zzzzzzzzzz")); }
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"))); }