コード例 #1
0
        public void DeleteExistingCircleByMember_ReturnUnauthorized()
        {
            //Arrange
            _controller.ControllerContext = new ControllerContext
            {
                HttpContext = new DefaultHttpContext
                {
                    User = new ClaimsPrincipal(new ClaimsIdentity(new Claim[]
                    {
                        new Claim(ClaimTypes.NameIdentifier, CommonTestData.AppUserList.Find(au => au.Id == 2).AccountId)
                    }))
                }
            };

            var result = _controller.Delete(1).Result;

            Assert.IsType <UnauthorizedResult>(result);
        }