use caesar_cipher_enc_dec::caesar_cipher::encrypt;
#[test]
fn test_encrypt_uppercase_only() {
let text = "ABC";
let shift = 3;
let result = encrypt(text, shift);
assert_eq!(result, "DEF");
}
#[test]
fn test_encrypt_lowercase_only() {
let text = "abc";
let shift = 3;
let result = encrypt(text, shift);
assert_eq!(result, "def");
}
#[test]
fn test_encrypt_mixed_case() {
let text = "AbCdEf";
let shift = 1;
let result = encrypt(text, shift);
assert_eq!(result, "BcDeFg");
}
#[test]
fn test_encrypt_with_numbers_and_symbols() {
let text = "A1!B2@C3#";
let shift = 1;
let result = encrypt(text, shift);
assert_eq!(result, "B1!C2@D3#");
}
#[test]
fn test_encrypt_with_spaces() {
let text = "Hello World";
let shift = 3;
let result = encrypt(text, shift);
assert_eq!(result, "Khoor Zruog");
}
#[test]
fn test_encrypt_full_sentence() {
let text = "I LOVE YOU.";
let shift = 3;
let result = encrypt(text, shift);
assert_eq!(result, "L ORYH BRX.");
}
#[test]
fn test_encrypt_shift_zero() {
let text = "ABC";
let shift = 0;
let result = encrypt(text, shift);
assert_eq!(result, "ABC");
}
#[test]
fn test_encrypt_shift_one_minimum_positive() {
let text = "A";
let shift = 1;
let result = encrypt(text, shift);
assert_eq!(result, "B");
}
#[test]
fn test_encrypt_shift_25_maximum_effective() {
let text = "A";
let shift = 25;
let result = encrypt(text, shift);
assert_eq!(result, "Z");
}
#[test]
fn test_encrypt_shift_26_full_wrap() {
let text = "ABC";
let shift = 26;
let result = encrypt(text, shift);
assert_eq!(result, "ABC");
}
#[test]
fn test_encrypt_shift_27_wrap_plus_one() {
let text = "ABC";
let shift = 27;
let result = encrypt(text, shift);
assert_eq!(result, "BCD");
}
#[test]
fn test_encrypt_shift_negative_one() {
let text = "B";
let shift = -1;
let result = encrypt(text, shift);
assert_eq!(result, "A");
}
#[test]
fn test_encrypt_shift_negative_25() {
let text = "Z";
let shift = -25;
let result = encrypt(text, shift);
assert_eq!(result, "A");
}
#[test]
fn test_encrypt_shift_negative_26_wrap() {
let text = "ABC";
let shift = -26;
let result = encrypt(text, shift);
assert_eq!(result, "ABC");
}
#[test]
fn test_encrypt_alphabet_boundary_a() {
let text = "A";
let shift = 1;
let result = encrypt(text, shift);
assert_eq!(result, "B");
}
#[test]
fn test_encrypt_alphabet_boundary_z_wrap() {
let text = "Z";
let shift = 1;
let result = encrypt(text, shift);
assert_eq!(result, "A");
}
#[test]
fn test_encrypt_lowercase_boundary_z_wrap() {
let text = "z";
let shift = 1;
let result = encrypt(text, shift);
assert_eq!(result, "a");
}
#[test]
fn test_encrypt_lowercase_boundary_a_negative() {
let text = "a";
let shift = -1;
let result = encrypt(text, shift);
assert_eq!(result, "z");
}
#[test]
fn test_encrypt_empty_string() {
let text = "";
let shift = 3;
let result = encrypt(text, shift);
assert_eq!(result, "");
}
#[test]
fn test_encrypt_non_ascii_characters_only() {
let text = "あいうえお";
let shift = 3;
let result = encrypt(text, shift);
assert_eq!(result, "あいうえお");
}
#[test]
fn test_encrypt_mixed_ascii_and_japanese() {
let text = "Hello世界";
let shift = 3;
let result = encrypt(text, shift);
assert_eq!(result, "Khoor世界");
}
#[test]
fn test_encrypt_extreme_positive_shift() {
let text = "A";
let shift = i16::MAX;
let result = encrypt(text, shift);
assert_eq!(result, "H");
}
#[test]
fn test_encrypt_extreme_negative_shift() {
let text = "A";
let shift = i16::MIN;
let result = encrypt(text, shift);
assert_eq!(result, "S");
}
#[test]
fn test_encrypt_numbers_only() {
let text = "12345";
let shift = 5;
let result = encrypt(text, shift);
assert_eq!(result, "12345");
}
#[test]
fn test_encrypt_special_characters_only() {
let text = "!@#$%^&*()";
let shift = 10;
let result = encrypt(text, shift);
assert_eq!(result, "!@#$%^&*()");
}
#[test]
fn test_encrypt_emoji() {
let text = "Hello 😀";
let shift = 3;
let result = encrypt(text, shift);
assert_eq!(result, "Khoor 😀");
}