示例#1
0
        public void Login_UserNotExist()
        {
            var login = new UserLoginDto
            {
                Email = "*****@*****.**",
                Password = "******"
            };

            _dataBase.Expect(x => x.FindBy(Arg<Expression<Func<UserTable, bool>>>.Is.Anything)).Return(new List<UserTable> ());
            _mapper.Stub(x => x.Map(Arg<UserTable>.Is.Null)).Return(null);
            _service.Login(login);
        }
示例#2
0
        public void Login_UserExist()
        {
            var userTable = new UserTable();
            var login = new UserLoginDto
            {
                Email = "*****@*****.**", Password = "******"
            };

            _dataBase.Expect(x => x.FindBy(Arg<Expression<Func<UserTable, bool>>>.Is.Anything)).Return(new List<UserTable> { userTable  });
            _mapper.Stub(x => x.Map(userTable)).Return(new UserRegistertionData());
            var actual = _service.Login(login);

            Assert.AreEqual(actual.GetType(), typeof(UserData));
        }