Skip to content

Commit

Permalink
Add tests for Context::clear_sessions and Context::set_sessions
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Brand <[email protected]>
  • Loading branch information
brandsimon committed Sep 12, 2023
1 parent 6fccc4d commit 1611ca2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tss-esapi/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ impl Context {
/// // used in calls to ESAPI no matter if it None
/// // or not.
/// context.set_sessions((auth_session, None, None));
/// # let (session_1, session_2, session_3) = context.sessions();
/// # assert_eq!(Some(auth_session), session_1);
/// # assert_eq!(None, session_2);
/// # assert_eq!(None, session_3);
/// ```
pub fn set_sessions(
&mut self,
Expand Down Expand Up @@ -192,6 +196,10 @@ impl Context {
///
/// // Clear auth sessions
/// context.clear_sessions();
/// # let (session_1, session_2, session_3) = context.sessions();
/// # assert_eq!(None, session_1);
/// # assert_eq!(None, session_2);
/// # assert_eq!(None, session_3);
/// ```
pub fn clear_sessions(&mut self) {
self.sessions = (None, None, None)
Expand Down

0 comments on commit 1611ca2

Please sign in to comment.