Lines
100 %
Functions
Branches
use super::*;
#[test]
fn account_suggestion_matches_case_insensitive() {
let suggestion = AccountSuggestion {
id: "123".into(),
name: "Checking Account".into(),
currency: Some("456".into()),
};
assert!(suggestion.matches("checking"));
assert!(suggestion.matches("ACCOUNT"));
assert!(suggestion.matches("Checking"));
assert!(!suggestion.matches("savings"));
}
fn account_suggestion_returns_correct_id() {
id: "acc-123".into(),
name: "Test".into(),
currency: Some("cur-456".into()),
assert_eq!(suggestion.get_id(), "acc-123");
fn tag_matches_name_or_value() {
let suggestion = TagSuggestion {
name: "category".into(),
value: Some("groceries".into()),
assert!(suggestion.matches("cat"));
assert!(suggestion.matches("CATEGORY"));
assert!(suggestion.matches("groc"));
assert!(!suggestion.matches("transport"));
fn tag_matches_name_only_when_no_value() {
name: "status".into(),
value: None,
assert!(suggestion.matches("stat"));
assert!(!suggestion.matches("value"));
fn tag_returns_name_as_id() {
name: "priority".into(),
value: Some("high".into()),
assert_eq!(suggestion.get_id(), "priority");