public void TestGetFileType()
        {
            // Arrange:
            const int id = 2;

            // Act:
            var result = _service.getFileTypeByProjectId(id);

            // Assert:
            Assert.AreEqual("css", result);
        }
Пример #2
0
 public ActionResult CreateNewProjectFile(CreateProjectFileViewModel model)
 {
     if (!ModelState.IsValid)
     {
         CreateProjectFileViewModel viewModel = new CreateProjectFileViewModel();
         viewModel._projectFileName = model._projectFileName;
         viewModel._projectID       = model._projectID;
         return(View("CreateNewProjectFile", viewModel));
     }
     else
     {
         model._projectFileType = _projectFileService.getFileTypeByProjectId(model._projectID);
         model._projectFileData = "";
         _projectFileService.addProjectFile(model);
         ProjectViewModel viewModel = _projectService.getProjectByProjectId(User.Identity.Name, model._projectID);
         return(View("DisplayProject", viewModel));
     }
 }