예제 #1
0
        public void CheckLogin_ShouldThrowArgumentNullException_WhenUsernameIsEmpty()
        {
            var mapperMock     = new Mock <IMappingProvider>();
            var hashingMock    = new Mock <IHashingPassword>();
            var unitOfWorkMock = new Mock <IEfUnitOfWork>();
            var repoMock       = new Mock <IEfGenericRepository <User> >();

            var userContext = new UserContext(mapperMock.Object, hashingMock.Object, unitOfWorkMock.Object, repoMock.Object);

            Assert.ThrowsException <ArgumentNullException>(() => userContext.CheckLogin("", It.IsAny <string>()));
        }
예제 #2
0
 public User LoginUser(string username, string password)
 {
     return(_userContext.CheckLogin(username, password));
 }