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 Task with required attributes. Assign it to the given primary workitem.
 /// </summary>
 /// <param name="name">The initial name of the task.</param>
 /// <param name="primaryWorkitem">The PrimaryWorkitem this Task will belong to.</param>
 /// <param name="attributes">Required attributes.</param>
 /// <returns>A newly minted Task that exists in the VersionOne system.</returns>
 public Task Task(string name, PrimaryWorkitem primaryWorkitem, IDictionary<string, object> attributes) {
     var task = new Task(instance) {
         Name = name, 
         Parent = primaryWorkitem
     };
     AddAttributes(task, attributes);
     task.Save();
     return task;
 }
 private static void RankAboveAll(Task first, params Task[] other) {
     foreach(var task in other) {
         first.RankOrder.SetAbove(task);
     }
 }