public void Test_ValidEmailSuccess() { #region Arrange string expectedStatusCode = "OK"; int userId = 3; #endregion #region acts GetUserByIdRequest getUsersRequest = new GetUserByIdRequest(userId); IRestResponse <dynamic> response = getUsersRequest.ExecuteRequest(); string emailResponse = response.Data.email.ToString(); #endregion #region Asserts bool isValidEmail = RegexHelpers.IsValidEmail(emailResponse); Assert.Multiple(() => { Assert.AreEqual(expectedStatusCode, response.StatusCode.ToString()); Assert.True(isValidEmail); //Etc }); #endregion }
public void Test_EmailInvalidoComSucesso() { #region Parameters string email = "email@valido"; #endregion #region Acoes bool isValidEmail = RegexHelpers.IsValidEmail(email); #endregion #region Asserts Assert.IsFalse(isValidEmail); #endregion }