public void Should_get_role_as_well()
 {
     var sut = new AccountServices(_repository);
     var user = sut.GetUserByAccount("john");
     Assert.AreNotEqual(0, user.UserRoles.Count);
     Assert.AreNotEqual(0, user.UserRoles.First().Role.Description  );
 }
        public void ValidAccountNumberWillReturnUser()
        {
            // arrange
            _MockUserRepository
                .Setup(x => x.GetByAccount("john"))
                .Returns(new User { UserId = 123 });

            _AccountServices = new AccountServices(_MockUserRepository.Object);

            // act
            User user = _AccountServices.GetUserByAccount("john");

            // assert
            Assert.AreEqual(123, user.UserId);
        }
        public void The_authentication_will_succeed()
        {
            // arrange
            _MockUserRepository
                .Setup(x => x.GetByUsername("yuma"))
                .Returns(new User {Password = AccountServices.GeneratePasswordHash("guitar"), Username = "******"});
            _AccountServices = new AccountServices(_MockUserRepository.Object);

            // act
            User user = _AccountServices.Login("yuma", "guitar");

            // assert
            Assert.IsNotNull(user);
            Assert.AreEqual("Johnny", user.Username);
        }