public void InternalServerError(ResultCode value) { // arrange var expected = StatusCodes.Status500InternalServerError; var sut = new ErrorCodeConverter(); // act var result = sut.Convert(value); var codedResult = result as StatusCodeResult; // assert Assert.Equal(expected, codedResult.StatusCode); }
public void NotFound() { // arrange var payload = ResultCode.NotFound; var sut = new ErrorCodeConverter(); // act var result = sut.Convert(payload); var notFoundResult = result as NotFoundResult; // assert Assert.NotNull(notFoundResult); }
public void BadRequest() { // arrange var payload = ResultCode.BadRequest; var expected = StatusCodes.Status400BadRequest; var sut = new ErrorCodeConverter(); // act var result = sut.Convert(payload); var conflictResult = result as StatusCodeResult; // assert Assert.Equal(expected, conflictResult.StatusCode); }
public void Unauthorized() { // arrange var payload = ResultCode.Unauthorized; var expected = StatusCodes.Status401Unauthorized; var sut = new ErrorCodeConverter(); // act var result = sut.Convert(payload); var conflictResult = result as StatusCodeResult; // assert Assert.Equal(expected, conflictResult.StatusCode); }