Ejemplo n.º 1
0
        public void Handler_ReturnsResult_FromUserManager_PasswordHasher(string password)
        {
            var userStore = new Mock<IUserStore<User, int>>(MockBehavior.Strict);
            var userManager = new UserManager<User, int>(userStore.Object);
            var handler = new HandleHashedPasswordQuery(userManager);
            var query = new HashedPassword(password);

            string result = handler.Handle(query).Result;

            result.ShouldNotBeNull();
        }
Ejemplo n.º 2
0
        public void Handler_ThrowsArgumentNullException_WhenPasswordIsNull()
        {
            var userStore = new Mock<IUserStore<User, int>>(MockBehavior.Strict);
            var userManager = new UserManager<User, int>(userStore.Object);
            var handler = new HandleHashedPasswordQuery(userManager);
            var query = new HashedPassword(null);

            var exception = Assert.Throws<ArgumentNullException>(() => handler.Handle(query).Result);

            exception.ShouldNotBeNull();
        }