private async Task OnDeleteProject()
 {
     this.DeleteConfirmation.Raise(new Confirmation
     {
         Title   = Resources.DeleteProjectConfirmation_Title,
         Content = Resources.DeleteProjectConfirmation_Content
     }, async(dialog) =>
     {
         if (dialog.Confirmed)
         {
             try
             {
                 if (SelectedProject.ProjectId != Guid.Empty)
                 {
                     await _adminService.DeleteProjectAsync(SelectedProject);
                 }
                 Projects.Remove(SelectedProject);
                 _canCreateNewProject = await _adminService.CanCreateNewProject(Company.CompanyId);
                 NewProject.RaiseCanExecuteChanged();
                 SelectedProject        = null;
                 IsProjectEditorVisible = false;
             }
             catch (TimeoutException timeoutEx)
             {
                 _eventAggregator.GetEvent <TimeoutErrorEvent>().Publish(timeoutEx);
             }
         }
     });
 }
Exemple #2
0
        public async System.Threading.Tasks.Task  DeleteProject()
        {
            Assert.AreNotEqual(Guid.Empty, company.CompanyId);

            Project project = new Project();

            project.CompanyId   = company.CompanyId;
            project.Name        = "My test project";
            project.Description = "Description";

            await service.CreateProjectAsync(project);

            Assert.IsNotNull(project.ProjectId);

            await service.DeleteProjectAsync(project);

            List <Project> projects = await service.ReadProjectsForCompanyAsync(company);

            Assert.AreEqual(0, projects.Count());
        }