예제 #1
0
        public void Get_ExistingUserId_ReturnsOkResult()
        {
            //Arrange
            _controller.ControllerContext = new ControllerContext
            {
                HttpContext = new DefaultHttpContext
                {
                    User = new ClaimsPrincipal(new ClaimsIdentity(new Claim[]
                    {
                        new Claim(ClaimTypes.NameIdentifier, CommonTestData.AppUserList[0].AccountId)
                    }))
                }
            };
            //Act
            var okResult = _controller.Get(2).Result;

            Assert.IsType <OkObjectResult>(okResult);
        }