public void StopDelegateSession_should_close_sessions() { // Given httpContextSession.Clear(); const int courseInSession = CustomisationId; httpContextSession.SetInt32($"SessionID-{courseInSession}", DefaultSessionId); // When sessionService.StopDelegateSession(CandidateId, httpContextSession); // Then A.CallTo(() => sessionDataService.StopDelegateSession(CandidateId)).MustHaveHappenedOnceExactly(); A.CallTo(() => sessionDataService.StopDelegateSession(A <int> ._)) .WhenArgumentsMatch((int candidateId) => candidateId != CandidateId) .MustNotHaveHappened(); }
public void StopDelegateSession(int candidateId, ISession httpContextSession) { sessionDataService.StopDelegateSession(candidateId); httpContextSession.Clear(); }