コード例 #1
0
        public void TypeMapper_GetType_AndReturnValidAnswer()
        {
            var actual = _mapper.TypeMapper(typeof (UserRegistertionData));
            var expected = new UserTable().GetType();

            Assert.IsTrue(actual.Name == expected.Name);
        }
コード例 #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));
        }