コード例 #1
0
 public void Test04ResetPassword()
 {
     Microsoft.AspNetCore.Mvc.IActionResult result = accountController.ResetPassword(_email, verificationCode, _password).Result;
     Assert.IsNotNull(result);
     Assert.IsTrue(result is OkObjectResult || result is OkResult);
     Assert.IsTrue((result as OkObjectResult)?.StatusCode == 200 || (result as OkResult).StatusCode == 200);
 }
コード例 #2
0
 public void Test03ForgotPassword()
 {
     Microsoft.AspNetCore.Mvc.IActionResult result = accountController.ForgotPassword(_email).Result;
     Assert.IsNotNull(result);
     Assert.IsTrue(result is OkObjectResult);
     Assert.IsTrue((result as OkObjectResult).StatusCode == 200);
     this.verificationCode = ((Microsoft.AspNetCore.Mvc.ObjectResult)result).Value.ToString();
 }
コード例 #3
0
        public void Test02Login()
        {
            LoginDto loginDto = new LoginDto
            {
                UserName = _email,
                Password = _password
            };

            Microsoft.AspNetCore.Mvc.IActionResult result = accountController.LoginAsync(loginDto).Result;

            Assert.IsNotNull(result);
            Assert.IsTrue(result is OkObjectResult);
            Assert.IsTrue((result as OkObjectResult).StatusCode == 200);
        }