Пример #1
0
        public void GetUserId()
        {
            var user  = new Mock <ClaimsPrincipal>();
            var claim = new Claim("username", "[USERNAME]");

            user.Setup(x => x.Claims).Returns(new List <Claim> {
                claim
            });
            Assert.AreEqual("[USERNAME]", AuthUtils.GetUserId(user.Object));
        }