Exemple #1
0
 public void TestgetProposalsWithoutFull()
 {
     proposalRepository.Add(proposal);
     Assert.AreEqual(1, proposalRepository.getProposalsWithoutFull().Count);
     proposalRepository.Delete(proposal);
     userRepository.Delete(user);
 }
        public void deleteProposalsWithoutFull()
        {
            List <Proposal> proposalsWithoutFull = proposalRepository.getProposalsWithoutFull();

            foreach (Proposal prop in proposalsWithoutFull)
            {
                foreach (User author in prop.Authors)
                {
                    Role role = roleRepository.getBySlug("listner");
                    author.UserRoles = new List <UserRole>()
                    {
                        new UserRole()
                        {
                            Role = role, RoleId = role.RoleId, User = author, UserId = author.UserId
                        }
                    };
                    userRepository.Update(author);
                }
                proposalRepository.Delete(prop);
            }
        }