예제 #1
0
        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();
        }
예제 #2
0
 public void StopDelegateSession(int candidateId, ISession httpContextSession)
 {
     sessionDataService.StopDelegateSession(candidateId);
     httpContextSession.Clear();
 }