use crate::context::Context;
use crate::context::builder::test_support::session;
#[test]
fn test_strict_context_mock_value_delegates_to_ctx() {
let ctx = Context::builder()
.session(session("app", "user", "sess-1"))
.invocation_id("inv-1")
.branch("b")
.build();
assert_eq!(
(
ctx.app_name(),
ctx.user_id(),
ctx.session_id(),
ctx.invocation_id(),
ctx.branch()
),
("app", "user", "sess-1", "inv-1", "b".to_string())
);
}
#[test]
fn test_strict_context_mock_adk_method_panics() {
let ctx = Context::builder().build();
assert_eq!(ctx.agent_name(), "test_agent");
assert!(
ctx.invocation_id().starts_with("e-"),
"default id {:?}",
ctx.invocation_id()
);
assert_eq!(
(ctx.app_name(), ctx.user_id(), ctx.session_id()),
("app", "user", "session")
);
assert_eq!(ctx.function_call_id(), "");
assert!(ctx.tool_confirmation().is_none() && ctx.sub_scheduler().is_none() && !ctx.ended());
}