Skip to content

Commit

Permalink
Merge pull request #432 from brandsimon/sbr/test_clear_session
Browse files Browse the repository at this point in the history
Add tests for Context::clear_sessions and Context::set_sessions
  • Loading branch information
wiktor-k authored Sep 14, 2023
2 parents 6fccc4d + 2ba1a36 commit a449af7
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!(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 a449af7

Please sign in to comment.