private void CreateTestData() { schedule = instance.Create.Schedule(TestScheduleName, new Duration(7, Duration.Unit.Days), new Duration(0, Duration.Unit.Days)); member = instance.Create.Member("test user", "test"); member.Save(); project = instance.Create.Project(TestProjectName, AssetID.FromToken("Scope:0"), DateTime.Now.Date, schedule); iteration = instance.Create.Iteration(project); iteration.Activate(); story1 = CreateStory(instance, "Story 1", project, iteration, instance.LoggedInMember); story1.Status.CurrentValue = "Future"; story1.Save(); if (dataLayer.EffortTracking.StoryTrackingLevel != EffortTrackingLevel.SecondaryWorkitem) { var story1Effort = story1.CreateEffort(EffortAmount); story1Effort.Save(); } story2 = CreateStory(instance, "Story 2", project, iteration, member); task1 = CreateTask(instance, "Task 1", story1, instance.LoggedInMember); if (dataLayer.EffortTracking.StoryTrackingLevel != EffortTrackingLevel.PrimaryWorkitem) { var task1Effort = task1.CreateEffort(EffortAmount); task1Effort.Save(); } task2 = CreateTask(instance, "Task 2", story1, member); task3 = CreateTask(instance, "Task 3", story2, member); }
/// <summary> /// Create a new story with a name. Set the story's IdentifiedIn to the given retrospective and the project to the retrospective's project. /// </summary> /// <param name="name">The initial name of the story.</param> /// <param name="retrospective">The retrospective this story was identified in.</param> /// <param name="attributes">Required attributes.</param> /// <returns>A newly minted Story that exists in the VersionOne system.</returns> public Story Story(string name, Retrospective retrospective, IDictionary<string, object> attributes) { var story = new Story(instance) { Name = name, IdentifiedIn = retrospective, Project = retrospective.Project }; AddAttributes(story, attributes); story.Save(); return story; }
/// <summary> /// Create a new Story with a name. /// </summary> /// <param name="name">The initial name of the entity.</param> /// <param name="project">The Project this Story will be in.</param> /// <param name="attributes">Required attributes.</param> /// <returns>A newly minted Story that exists in the VersionOne system.</returns> public Story Story(string name, Project project, IDictionary<string, object> attributes) { var story = new Story(instance) { Name = name, Project = project }; AddAttributes(story, attributes); story.Save(); return story; }
/// <summary> /// Index a story /// </summary> /// <param name="story">the story to process</param> private void Index(Story story) { Document doc = IndexCommonFields(story); doc.Add(UnStored("Build", story.Build)); if(null != story.Customer) doc.Add(UnStored("Customer", story.Customer.Name)); doc.Add(UnStored("RequestedBy", story.RequestedBy)); if(null != story.Risk) doc.Add(UnStored("Risk", story.Risk.CurrentValue)); if(null != story.Type) doc.Add(UnStored("Type", story.Type.CurrentValue)); _luceneIndexWriter.AddDocument(doc); }