()
| 897 | |
| 898 | #[test] |
| 899 | fn test_store_default_by_usage() { |
| 900 | let (_temp, mut store) = create_test_store(); |
| 901 | |
| 902 | let personal = Identity::builder("alice-personal") |
| 903 | .usage(IdentityUsage::Personal) |
| 904 | .build() |
| 905 | .unwrap(); |
| 906 | let work = Identity::builder("alice-work") |
| 907 | .usage(IdentityUsage::Work) |
| 908 | .build() |
| 909 | .unwrap(); |
| 910 | |
| 911 | store.save(&personal).unwrap(); |
| 912 | store.save(&work).unwrap(); |
| 913 | |
| 914 | store |
| 915 | .set_default_for_usage(&IdentityUsage::Work, &work.id) |
| 916 | .unwrap(); |
| 917 | |
| 918 | let work_default = store |
| 919 | .get_default_for_usage(&IdentityUsage::Work) |
| 920 | .unwrap() |
| 921 | .unwrap(); |
| 922 | assert_eq!(work_default.id, work.id); |
| 923 | |
| 924 | // Personal should fall back to None (no global default set) |
| 925 | assert!(store |
| 926 | .get_default_for_usage(&IdentityUsage::Personal) |
| 927 | .unwrap() |
| 928 | .is_none()); |
| 929 | } |
| 930 | |
| 931 | #[test] |
| 932 | fn test_store_exists() { |
nothing calls this directly
no test coverage detected