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

            ShouldDelete = false;

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

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

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

            var story = CreateStory(project);

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