GetFiles() public method

Method to get all the available files for the specified user.
public GetFiles ( bool>.Func predicate ) : IEnumerable
predicate bool>.Func Function that is used to filter records
return IEnumerable
        public void Get_All_Files_Test()
        {
            IFileRepository repository = new FileRepository(testDBContext);

            int userId = 1;
            string postStatus = FileStatus.Posted.ToString();
            Func<File, bool> filter = file => file.CreatedBy == userId && (file.Status.Equals(postStatus, StringComparison.InvariantCulture) || file.isDeleted == null || file.isDeleted == false);
            var fileList = repository.GetFiles(filter);

            Assert.IsNotNull(fileList);

            Assert.AreEqual(fileList.Count(), 2);

            Assert.AreEqual(fileList.ToList()[0].FileId, 1);
            Assert.AreEqual(fileList.ToList()[1].FileId, 2);

            Assert.AreEqual(fileList.ToList()[0].Name, "Document One");
            Assert.AreEqual(fileList.ToList()[1].Name, "Document Two");
        }
        public void Remove_Mentioned_File_Permenently_Test()
        {
            IFileRepository repository = new FileRepository(testDBContext);

            var result = repository.DeleteFile(1, "Posted");

            testDBContext.Commit();

            Assert.IsNotNull(result);

            int userId = 1;
            string postStatus = FileStatus.Posted.ToString();
            Func<File, bool> filter = file => file.CreatedBy == userId && (file.Status.Equals(postStatus, StringComparison.InvariantCulture) || file.isDeleted == null || file.isDeleted == false);
            var fileList = repository.GetFiles(filter);

            Assert.AreEqual(fileList.Count(), 1);

            Assert.AreEqual(fileList.ToList()[0].FileId, 2);

            Assert.AreEqual(fileList.ToList()[0].Name, "Document Two");
        }