public void ReturnErrorMessageIfUserNameNotFound() { // Arrange // Act var result = sutUserNameNotFound.ConfirmUserName(email); var message = ((AuthenticationResult)((NotFoundObjectResult)result.Result).Value).Message; // Assert Assert.That(result, Is.TypeOf <Task <ActionResult> >()); Assert.That(message, Is.EqualTo("Status Code 404: No User is using this Email")); }
public void ReturnUserName() { // Arrange // Act var result = sut.ConfirmUserName(email); var message = ((AuthenticationResult)((OkObjectResult)result.Result).Value).Message; var username = ((AuthenticationResult)((OkObjectResult)result.Result).Value).UserName; // Assert Assert.That(result, Is.TypeOf <Task <ActionResult> >()); Assert.That(message, Is.EqualTo("Status Code 200: User Name Confirmed")); Assert.That(username, Is.EqualTo(userName)); }