public async Task ThrowServerSideExceptionResponse()
        {
            ThrowServerSideExceptionResponse ThrowServerSideExceptionResponse =
                await GetJsonAsync <ThrowServerSideExceptionResponse>(ThrowServerSideExceptionRequest.GetRoute());

            ValidateThrowServerSideExceptionResponse(ThrowServerSideExceptionResponse);
        }
            /// <summary>
            /// Intentionally throw so we can test exception handling.
            /// </summary>
            /// <param name="aThrowServerSideExceptionAction"></param>
            /// <param name="aCancellationToken"></param>
            /// <returns></returns>
            public override async Task <Unit> Handle
            (
                ThrowServerSideExceptionAction aThrowServerSideExceptionAction,
                CancellationToken aCancellationToken
            )
            {
                var throwServerSideExceptionRequest = new ThrowServerSideExceptionRequest();

                ThrowServerSideExceptionResponse throwServerSideExceptionResponse =
                    await HttpClient.GetFromJsonAsync <ThrowServerSideExceptionResponse>(throwServerSideExceptionRequest.GetRoute());

                return(Unit.Value);
            }
 private void ValidateThrowServerSideExceptionResponse(ThrowServerSideExceptionResponse aThrowServerSideExceptionResponse)
 {
     aThrowServerSideExceptionResponse.CorrelationId.Should().Be(ThrowServerSideExceptionRequest.CorrelationId);
     // check Other properties here
 }
示例#4
0
        public async Task ThrowServerSideExceptionResponse()
        {
            ThrowServerSideExceptionResponse ThrowServerSideExceptionResponse = await Send(ThrowServerSideExceptionRequest);

            ValidateThrowServerSideExceptionResponse(ThrowServerSideExceptionResponse);
        }