public ProjectInfo(Project p) { ProjectName = p.ProjectName; ProjectNumber = p.ProjectNumber; ProjectUId = p.ProjectUId; ClientName = p.ClientName; }
public bool IsTheSame(Project p) { if (p == null) return false; return this.ProjectName == p.ProjectName && this.ProjectNumber == p.ProjectNumber && this.ClientName == p.ClientName && this.CodeRepositoryPath == p.CodeRepositoryPath && this.DocRepositoryPath == p.DocRepositoryPath && this.Description == p.Description && this.ProjectType == p.ProjectType && this.AnyoneCanJoin == p.AnyoneCanJoin && this.IsSuspended == p.IsSuspended; }
public void Disposing_Tasks_On_Project_Changed() { // creates a Task list IEventAggregator aggregator = new ScrumFactory.Composition.EventAggregator(); ViewModel.TasksListViewModel list = new ViewModel.TasksListViewModel( null, null, null, aggregator, null, null); // create a task and adds to the task list view model List<ViewModel.TaskViewModel> tasks = new List<ViewModel.TaskViewModel>(); Mock<ViewModel.TaskViewModel> taskVM = new Mock<ViewModel.TaskViewModel>( null, null, aggregator, null, null, new Task(), null); tasks.Add(taskVM.Object); list.Tasks = tasks; // emulates a project change Project project = new Project(); aggregator.Publish<Project>(ScrumFactoryEvent.ViewProjectDetails, project); taskVM.Verify(i => i.Dispose(), "Dispose was not called"); }
private ViewModel.IterationPlanningViewModel PrepareSprintListViewModel(out Mock<ViewModel.SprintViewModel> sprintVM) { // creates a fake backlogservice Mock<Services.IBacklogService> backlogService = new Mock<Services.IBacklogService>(); backlogService.Setup(b => b.GetCurrentBacklog(It.IsAny<string>(), It.IsAny<short>(), DateTime.MinValue, DateTime.MinValue)) .Returns(new List<BacklogItem>()); // creates a immediate bg executor Mock<IBackgroundExecutor> executor = BackgroundExecutorMock.SetupExecutorForCollectionOf<BacklogItem>(null); BackgroundExecutorMock.SetupExecutorForAction(executor); // creates a sprint list IEventAggregator aggregator = new ScrumFactory.Composition.EventAggregator(); ViewModel.IterationPlanningViewModel list = new ViewModel.IterationPlanningViewModel( backlogService.Object, null, executor.Object, null, aggregator, null); // assign a project to the list (no items yet, so no dispose by now) Project p = new Project(); p.Sprints = new List<Sprint>(); p.Sprints.Add(new Sprint() { SprintNumber = 1 }); aggregator.Publish<Project>(ScrumFactoryEvent.ViewProjectDetails, p); // create a sprint and adds to the backlog list view model System.Collections.ObjectModel.ObservableCollection<ViewModel.SprintViewModel> sprints = new System.Collections.ObjectModel.ObservableCollection<ViewModel.SprintViewModel>(); sprintVM = new Mock<ViewModel.SprintViewModel>( null, null, aggregator, p.Sprints[0], null); sprints.Add(sprintVM.Object); list.SprintPlans = sprints; return list; }
public void Disposing_Sprints_On_Project_Changed() { // creates a backlog list IEventAggregator aggregator = new ScrumFactory.Composition.EventAggregator(); ViewModel.IterationPlanningViewModel list = new ViewModel.IterationPlanningViewModel( null, null, null, null, aggregator, null); // create a item and adds to the backlog list view model System.Collections.ObjectModel.ObservableCollection<ViewModel.SprintViewModel> sprints = new System.Collections.ObjectModel.ObservableCollection<ViewModel.SprintViewModel>(); Mock<ViewModel.SprintViewModel> sprintVM = new Mock<ViewModel.SprintViewModel>( null, null, aggregator, new Sprint(), null); sprints.Add(sprintVM.Object); list.SprintPlans = sprints; // emulates a project change Project p = new Project(); p.Sprints = new List<Sprint>(); p.Sprints.Add(new Sprint()); aggregator.Publish<Project>(ScrumFactoryEvent.ViewProjectDetails, p); sprintVM.Verify(i => i.Dispose(), "Dispose was not called"); }
private void OnViewProjectDetails(Project project) { this.project = project; NeedRefresh = true; ((DelegateCommand)AddGroupCommand).NotifyCanExecuteChanged(); ((DelegateCommand<BacklogItemGroup>)UpdateGroupCommand).NotifyCanExecuteChanged(); // DO NOT CLEAR GROUPS HERE BECAUSE, COMBOBOX ITEMSSOURCE MAY BE BINDED // TO IT, AND IT MAY NULL THE GROUPID //Groups = null; }
private void OnViewProjectDetails(Project project) { this.project = project; ((DelegateCommand)AddArtifactCommand).NotifyCanExecuteChanged(); ((DelegateCommand<string>)RemoveArtifactCommand).NotifyCanExecuteChanged(); ((DelegateCommand<string>)StartEditCommand).NotifyCanExecuteChanged(); }