()
| 1080 | |
| 1081 | #[test] |
| 1082 | fn test_get_active_mut() { |
| 1083 | let mut collection = Agents::default(); |
| 1084 | assert!(collection.get_active_mut().is_none()); |
| 1085 | |
| 1086 | let agent = Agent::default(); |
| 1087 | collection.agents.insert("default".to_string(), agent); |
| 1088 | collection.active_idx = "default".to_string(); |
| 1089 | |
| 1090 | assert!(collection.get_active_mut().is_some()); |
| 1091 | let active = collection.get_active_mut().unwrap(); |
| 1092 | active.description = Some("Modified description".to_string()); |
| 1093 | |
| 1094 | assert_eq!( |
| 1095 | collection.agents.get("default").unwrap().description, |
| 1096 | Some("Modified description".to_string()) |
| 1097 | ); |
| 1098 | } |
| 1099 | |
| 1100 | #[test] |
| 1101 | fn test_switch() { |
nothing calls this directly
no test coverage detected