public void Data_Read_User_By_Password_Reset_GUID()
        {
            var repository = new UserRepository(_dataConnectionString, 1);

            var data = repository.GetByPasswordResetGUID("7cc68dbb-3d12-487b-8295-e9b226cda017");

            Assert.IsTrue(data.UserID == 1);
            Assert.IsTrue(data.Email == "*****@*****.**");
        }
        public void Data_Read_User()
        {
            var repository = new UserRepository(_dataConnectionString, 1);

            var data = repository.Get(1);

            Assert.IsTrue(data.UserID == 1);
            Assert.IsTrue(data.Email == "*****@*****.**");
        }
        public void Data_Read_User_By_Email()
        {
            var repository = new UserRepository(_dataConnectionString, 1);

            var data = repository.GetByEmailAddress("*****@*****.**");

            Assert.IsTrue(data.UserID == 1);
            Assert.IsTrue(data.Forename == "Test");
            Assert.IsTrue(data.Surname == "User");
        }
        public void Data_Read_Deleted_User_By_Password_Reset_GUID()
        {
            var repository = new UserRepository(_dataConnectionString, 1);

            var data = repository.GetByPasswordResetGUID("5b977b67-e7e6-4399-9866-6c011750249f");

            Assert.IsTrue(data == null);
        }
        public void Data_Read_Deleted_User_By_Email()
        {
            var repository = new UserRepository(_dataConnectionString, 1);

            var data = repository.GetByEmailAddress("*****@*****.**");

            Assert.IsTrue(data == null);
        }
        public void Data_Delete_User()
        {
            var repository = new UserRepository(_dataConnectionString, 1);

            var result = repository.Delete(1);

            var user = repository.Get(1);

            Assert.IsTrue(user == null);
            Assert.IsTrue(result.Deleted == true);
            Assert.IsTrue(result.DeletedBy == 1);
            Assert.IsTrue(result.DeletedDate.Value.Date == DateTime.Now.Date);
        }
        public void Data_Create_User()
        {
            var repository = new UserRepository(_dataConnectionString, 1);

            var user = new MABMoney.Domain.User
            {
                Forename = "ADDEDFORENAME",
                Surname = "ADDEDSURNAME",
                Email = "*****@*****.**",
                Password = "******" // "password"
            };

            var result = repository.Add(user);

            Assert.IsTrue(result.UserID == 3);
            Assert.IsTrue(result.Forename == "ADDEDFORENAME");
            Assert.IsTrue(result.Surname == "ADDEDSURNAME");
            Assert.IsTrue(result.Email == "*****@*****.**");
            Assert.IsTrue(result.Password == "AEVg+8Chm8T0NSff0k0qegArPYXetlQfvKEoaDXwnT0N9fj0TVAjorveDX9vfbcVwA==");
            Assert.IsTrue(result.CreatedDate.Date == DateTime.Now.Date);
        }
        public void Data_Update_User()
        {
            var repository = new UserRepository(_dataConnectionString, 1);

            var user = repository.Get(1);

            user.Forename = "UPDATEDFORENAME";
            user.Surname = "UPDATEDSURNAME";
            user.Email = "*****@*****.**";
            user.Password = "******"; // "password"
            user.PasswordResetGUID = "0c4ffa03-e3d7-48b6-b657-bdae23f5d14d";
            user.PasswordResetExpiry = new DateTime(2015, 1, 1);

            var result = repository.Update(user);

            Assert.IsTrue(result.Forename == "UPDATEDFORENAME");
            Assert.IsTrue(result.Surname == "UPDATEDSURNAME");
            Assert.IsTrue(result.Email == "*****@*****.**");
            Assert.IsTrue(result.Password == "AEVg+8Chm8T0NSff0k0qegArPYXetlQfvKEoaDXwnT0N9fj0TVAjorveDX9vfbcVwA==");
            Assert.IsTrue(result.PasswordResetGUID == "0c4ffa03-e3d7-48b6-b657-bdae23f5d14d");
            Assert.IsTrue(result.PasswordResetExpiry == new DateTime(2015, 1, 1));
            Assert.IsTrue(result.LastModifiedBy == 1);
            Assert.IsTrue(result.LastModifiedDate.Date == DateTime.Now.Date);
        }