public void ShouldThrowNoResultExceptionWhenNoResultWasReported() { //GIVEN var connectionInProgress = new JsonBasedConnectionInProgress(); //WHEN - THEN new Action(() => connectionInProgress.ToActionResult()) .Should().ThrowExactly <NoResultException>(); }
public void ShouldReturnInvalidOtherUserIdWhenInvalidOtherUserIdReported() { //GIVEN var connectionInProgress = new JsonBasedConnectionInProgress(); connectionInProgress.InvalidOtherUserId(); //WHEN var actionResult = connectionInProgress.ToActionResult(); //THEN actionResult.Should().BeOfType <BadRequestObjectResult>() .Which.Value.Should().Be("Invalid other user ID."); }
public void ShouldReturnNoOtherUserFoundWhenNoOtherUserFoundReported() { //GIVEN var connectionInProgress = new JsonBasedConnectionInProgress(); connectionInProgress.OtherUserNotFound(); //WHEN var actionResult = connectionInProgress.ToActionResult(); //THEN actionResult.Should().BeOfType <BadRequestObjectResult>() .Which.Value.Should().Be("Other user not found."); }
public void ShouldReturnUserConvertedToJsonWhenSuccessReported() { //GIVEN var connectionInProgress = new JsonBasedConnectionInProgress(); var userDto = Any.Instance <UserDto>(); connectionInProgress.Success(userDto); //WHEN var actionResult = connectionInProgress.ToActionResult(); //THEN actionResult.Should().BeOfType <JsonResult>() .Which.Value.Should().Be(userDto); }