Esempio n. 1
0
        public void ForOtherClaimIdentifier_ThenNullReturned()
        {
            var handler = new GetUserByClaimId(_userRepo.Object);

            var retrievedUser = handler.Execute("1");

            Assert.Null(retrievedUser);
        }
Esempio n. 2
0
        public void ThenUserReturned()
        {
            var user = new User { UserId = 1, DisplayName = "a friendly name" };

            _userRepo
                .Setup(ur => ur.GetByAuthenticatedId("1"))
                .Returns(new User { UserId = 1, DisplayName = "a friendly name" });

            var handler = new GetUserByClaimId(_userRepo.Object);

            var retrievedUser = handler.Execute("1");

            Assert.NotNull(retrievedUser);
            Assert.Equal(user.UserId, retrievedUser.UserId);
        }