예제 #1
0
 public IEnumerable <ProjectDto> ProjectsOnPage(int?page, string firstLetter, string filterText, int?recordPerPage)
 {
     if (firstLetter == null)
     {
         firstLetter = "";
     }
     if (filterText == null)
     {
         filterText = "";
     }
     if (recordPerPage == null || recordPerPage <= 0)
     {
         recordPerPage = 3;
     }
     if (page == null || page <= 0)
     {
         recordPerPage = ProjectRepository.AllProjects().Count;
         page          = 0;
     }
     else
     {
         page -= 1;
     }
     return(Mapper.Map <IList <ProjectDto> >(ProjectRepository.ProjectsOnPage((int)page, firstLetter, filterText, (int)recordPerPage)));
 }
        public void AddAProjectToRepository()
        {
            var projectRepository = new ProjectRepository();
            var project = new Project("secrets");
            var addProjectCommand = new AddProjectCommand(projectRepository, "secrets");

            addProjectCommand.Execute();

            Assert.That(projectRepository.AllProjects()[0], Is.EqualTo(project));
        }
예제 #3
0
 public IEnumerable <dynamic> AllProjects()
 {
     return(ProjectRepository.AllProjects());
 }