public ProjectViewModel(Project project) : base(null, true) { Project = project; ShouldDelete = false; repo = App.kernel.Get<IRepository>(); }
public void CreateProject() { var project = new Project(); project.Name = "Name"; var projectViewModel = new ProjectViewModel(project) { IsSelected = true, IsExpanded = true }; ProjectViewModels.Add(projectViewModel); repo.Save<Project>(project); OnPropertyChanged("ProjectViewModels"); }
public void Given_Repository(bool cleanFolders) { if(cleanFolders) DeleteFiles(); serializer = new ItemJsonSerializer(dataPath); repo = new ItemRepository(serializer); repo.DataPath = dataPath; projectItem = repo.Create<Project>() as Project; storyItem = repo.Create<Story>() as Story; scenarioItem = repo.Create<Scenario>() as Scenario; interactionItem = new Interaction(); dataItem = new DataItem(); }
public void SaveProject(Project project) { itemSerializer.Save(project, project.Id.ToString()); project.Stories.ForEach(s => itemSerializer.Save(s, s.Id.ToString())); }
public Project DeleteStory(Project project, Story story) { project.StoryIds.Remove(story.Id); project.Stories.Remove(story); story.Scenarios.ForEach(s => DeleteScenario(story, s)); DeleteFile(story.Id, story.Type); return project; }
public void DeleteProject(Project project) { project.Stories.ForEach(s => DeleteStory(project, s)); DeleteFile(project.Id, project.Type); }
public Story CreateStory(Project parentProject) { var story = new Story() { ParentId = parentProject.Id }; var scenario = CreateScenario(story); parentProject.StoryIds.Add(story.Id); parentProject.Stories.Add(story); SaveProject(parentProject); return story; }
public Project CreateProject() { var project = new Project(); var story = CreateStory(project); return project; }
public static void ShouldEqual(this Project actual, Project expected) { Assert.AreEqual(expected, actual); }