public void When_Retrieving_Single_User_by_Email_Return_User()
        {
            //Arrange
            var expected = _testData.First();

            var input = new ByUserEmail
            {
                UserEmail = expected.Email
            };

            User actual;

            //Act
            actual = _subject.Retrieve(input);

            //Assert
            Assert.AreEqual(expected.CreationDate, actual.CreationDate, string.Format("Expected:{0} for CreationDate, Actual was {1}", expected.CreationDate, actual.CreationDate));
            Assert.AreEqual(expected.Email, actual.Email, string.Format("Expected:{0} for Email, Actual was {1}", expected.Email, actual.Email));
            Assert.AreEqual(expected.FirstName, actual.FirstName, string.Format("Expected:{0} for FirstName, Actual was {1}", expected.FirstName, actual.FirstName));
            Assert.AreEqual(expected.LastName, actual.LastName, string.Format("Expected:{0} for LastName, Actual was {1}", expected.LastName, actual.LastName));
            Assert.AreEqual(expected.LastLogin, actual.LastLogin, string.Format("Expected:{0} for LastLogin, Actual was {1}", expected.LastLogin, actual.LastLogin));
            Assert.AreEqual(expected.UserId, actual.UserId, string.Format("Expected:{0} for UserId, Actual was {1}", expected.UserId, actual.UserId));
        }
        /// <summary>
        /// Buisness Requirements:
        /// 1. Verify if Email address is in use.
        /// 2. If it is in use, throw exception.
        /// 3. Exception message should include email that was found to be in use.
        /// 4. If not in use, do nothing.
        /// </summary>
        public void VerifyEmailIsntInUse(UserAccount newAccount)
        {
            var query = new ByUserEmail
            {
                UserEmail = newAccount.Email
            };

            var userDetails = _retrieveUserByEmail.Retrieve(query);

            if (userDetails == null) throw new ArgumentException("Email Address: {0} already in use.", newAccount.Email);
        }
        public User GetUser(string email)
        {
            var query = new ByUserEmail
            {
                UserEmail = email
            };

            var userDetails = _retrieveUserByEmail.Retrieve(query);

            if(userDetails == null) throw new ArgumentException("Email Address: {0} has no matching account.", email);

            return userDetails;
        }