public void Index_Sets_AllFilePaths_As_Model()
        {
            var expectedModel = new List <FilePath>();

            FilePathRepo.GetAll().Returns(expectedModel);
            var result = underTest.Index(id);

            var model = ((ViewResult)result).Model;

            Assert.Equal(expectedModel, model);
        }
Esempio n. 2
0
        public IActionResult Index(int id)
        {
            var model = filePathRepo.GetAll();

            model = from filePath in model
                    where filePath.ProjectId == id //must be true
                    where filePath.Project.ProjectOwnerId == User.FindFirstValue(ClaimTypes.NameIdentifier)
                    orderby filePath.ProjectId     // sorts by the date
                    select filePath;

            ViewBag.ProjectId = id;
            var project = projectRepo.GetById(id);

            ViewBag.ProjectName = project.ProjectName;

            return(View(model));
        }