public void StoreAspProgressNoSession_returns_exception_from_session_validation() { // Given StoreAspServiceReturnsDefaultDetailedCourseProgressOnValidation(); A.CallTo( () => storeAspService.ParseSessionIdAndValidateSessionForStoreAspNoSessionEndpoints( A <string?> ._, A <int> ._, A <int> ._, A <TrackerEndpointResponse> ._ ) ).Returns((TrackerEndpointResponse.StoreAspProgressException, null)); // When var result = trackerActionService.StoreAspProgressNoSession( DefaultProgressId, DefaultCustomisationVersion, DefaultLmGvSectionRow, DefaultTutorialId, DefaultTutorialTime, DefaultTutorialStatus, DefaultDelegateId, DefaultCustomisationId, DefaultSessionId.ToString() ); // Then result.Should().Be(TrackerEndpointResponse.StoreAspProgressException); A.CallTo( () => storeAspService.StoreAspProgressAndSendEmailIfComplete( A <DetailedCourseProgress> ._, A <int> ._, A <string?> ._, A <int> ._, A <int> ._, A <int> ._ ) ).MustNotHaveHappened(); A.CallTo( () => storeAspService.ParseSessionIdAndValidateSessionForStoreAspNoSessionEndpoints( DefaultSessionId.ToString(), DefaultDelegateId, DefaultCustomisationId, TrackerEndpointResponse.StoreAspProgressException ) ).MustHaveHappenedOnceExactly(); }
ParseSessionIdAndValidateSessionForStoreAspNoSessionEndpoints_returns_specified_exception_when_session_ID_is_not_integer( string?sessionId, int trackerEndpointResponseId ) { // Given var suppliedResponse = Enumeration.FromId <TrackerEndpointResponse>(trackerEndpointResponseId); // When var result = storeAspService.ParseSessionIdAndValidateSessionForStoreAspNoSessionEndpoints( sessionId, DefaultDelegateId, DefaultCustomisationVersion, suppliedResponse ); // Then using (new AssertionScope()) { result.parsedSessionId.Should().BeNull(); result.validationResponse.Should().Be(suppliedResponse); A.CallTo(() => sessionDataService.GetSessionById(A <int> ._)).MustNotHaveHappened(); } }