예제 #1
0
        public ProjectViewModel(Project project)
            : base(null, true)
        {
            Project = project;

            ShouldDelete = false;

            repo = App.kernel.Get<IRepository>();
        }
예제 #2
0
        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");
        }
예제 #3
0
        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();
        }
예제 #4
0
        public void SaveProject(Project project)
        {
            itemSerializer.Save(project, project.Id.ToString());

            project.Stories.ForEach(s => itemSerializer.Save(s, s.Id.ToString()));
        }
예제 #5
0
        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;
        }
예제 #6
0
        public void DeleteProject(Project project)
        {
            project.Stories.ForEach(s => DeleteStory(project, s));

            DeleteFile(project.Id, project.Type);
        }
예제 #7
0
        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;
        }
예제 #8
0
        public Project CreateProject()
        {
            var project = new Project();

            var story = CreateStory(project);

            return project;
        }
예제 #9
0
 public static void ShouldEqual(this Project actual, Project expected)
 {
     Assert.AreEqual(expected, actual);
 }