public void AddComment() { var mockery = new MockRepository(); var storyService = mockery.StrictMock<IStoryService>(); var storyId = 1; var projectId = 3; var comment = "comment"; var story = new Story(); using (mockery.Record()) using (mockery.Ordered()) { storyService.AddComment(projectId, storyId, comment); Expect.Call(storyService.GetStory(projectId, storyId)).Return(story); } using(mockery.Playback()){ var controller = new StoriesController(storyService); var result = controller.AddComment(projectId, storyId, comment); var partialResult = result as PartialViewResult; Assert.NotNull(partialResult); var model = partialResult.Model as StoryRowViewModel; Assert.NotNull(model); Assert.AreEqual(story, model.Story); } }
public Story AddNewStory(int projectId, Story toBeSaved) { var request = BuildPostRequest(); request.Resource = string.Format(SaveStoryEndpoint, projectId, toBeSaved.Name, toBeSaved.RequestedBy, toBeSaved.Description, toBeSaved.StoryType); var response = RestClient.Execute<Story>(request); var story = response.Data; return story; }
public void CanRetrieveAllStories() { var story = new Story { Name = "Nouvelle histoire", RequestedBy = "pivotaltrackerdotnet", StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId }; var savedStory = storyService.AddNewStory(Constants.ProjectId, story); var stories = storyService.GetAllStories(Constants.ProjectId); Assert.NotNull(stories); Assert.AreEqual(1, stories.Count); Assert.AreEqual(savedStory.Id, stories[0].Id); }
[Test] //, Ignore("The code works, but the lag from pivotal is such that it requires to sleep for close to a minute to pass")] public void CanRetrieveAllStories_Paging() { var story = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId }; var story2 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Bug, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId }; this.storyService.AddNewStory(Constants.ProjectId, story); this.storyService.AddNewStory(Constants.ProjectId, story2); //// System.Threading.Thread.Sleep(30000); // There is a lag in pivotal tracker's filter search. removing the slepp will cause the test to fail occasionally var stories = this.storyService.GetAllStories(Constants.ProjectId, 2, 0); Assert.NotNull(stories); Assert.AreEqual(2, stories.Data.Count); Assert.AreEqual(2, stories.Pagination.Returned); Assert.AreEqual(2, stories.Pagination.Total); stories = this.storyService.GetAllStories(Constants.ProjectId, 1, 1); Assert.NotNull(stories); Assert.AreEqual(1, stories.Data.Count); Assert.AreEqual(1, stories.Pagination.Returned); Assert.AreEqual(2, stories.Pagination.Total); }
public void ActivityProcessingTest() { int storyId; { var story = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId }; var savedStory = this.storyService.AddNewStory(Constants.ProjectId, story); var task1 = new Task { Description = "stuff stuff stuff", StoryId = savedStory.Id, ProjectId = Constants.ProjectId }; var task2 = new Task { Description = "stuff stuff stuff", StoryId = savedStory.Id, ProjectId = Constants.ProjectId }; var savedTask1 = this.storyService.AddNewTask(task1); savedStory.Labels = new List<Label>() { "Label1", "Label2" }; savedStory.Estimate = 3; savedStory = this.storyService.UpdateStory(Constants.ProjectId, savedStory); var savedTask2 = this.storyService.AddNewTask(task2); this.storyService.AddComment(savedStory.ProjectId, savedStory.Id, "Comment 1"); this.storyService.AddComment(savedStory.ProjectId, savedStory.Id, "Comment 2"); savedStory.Name = "New story"; savedStory.Deadline = DateTimeOffset.Now.AddDays(10); savedStory.Estimate = 3; savedStory = this.storyService.UpdateStory(Constants.ProjectId, savedStory); storyId = savedStory.Id; } var activities = this.storyService.GetStoryActivity(Constants.ProjectId, storyId); activities = activities.OrderBy(a => a.OccurredAt).ToList(); var accumulatedStoryValues = new Dictionary<string, object>(); var accumulatedTasksValues = new Dictionary<int, Dictionary<string, object>>(); var accumulatedCommentValues = new Dictionary<int, Dictionary<string, object>>(); var accumulatedLabelValues = new Dictionary<int, Dictionary<string, object>>(); var deserializer = new DictionaryDeserializer(); var foundObjects = new List<object>(); foreach (var activity in activities) { foreach (var change in activity.Changes) { if (change.NewValues != null && change.NewValues.Count == 1 && change.NewValues.ContainsKey("updated_at")) continue; // Skip story changes without any significat changes switch (change.Kind) { case ResourceKind.Story: { if (change.NewValues != null) change.NewValues.ToList().ForEach(kp => accumulatedStoryValues[kp.Key] = kp.Value); else if (change.OriginalValues != null) change.OriginalValues.ToList().ForEach(kp => accumulatedStoryValues[kp.Key] = kp.Value); var story = deserializer.Deserialize<Story>(accumulatedStoryValues); if (activity.OccurredAt != DateTimeOffset.MinValue || (change.NewValues != null && !change.NewValues.ContainsKey("updated_at"))) { story.UpdatedAt = activity.OccurredAt; } foundObjects.Add(story); break; } case ResourceKind.Comment: { Dictionary<string, object> values; if (!accumulatedTasksValues.TryGetValue(change.Id, out values)) { values = accumulatedTasksValues[change.Id] = new Dictionary<string, object>(); } if (change.NewValues != null) change.NewValues.ToList().ForEach(kp => values[kp.Key] = kp.Value); else if (change.OriginalValues != null) change.OriginalValues.ToList().ForEach(kp => values[kp.Key] = kp.Value); var comment = deserializer.Deserialize<Comment>(values); if (activity.OccurredAt != DateTimeOffset.MinValue || (change.NewValues != null && !change.NewValues.ContainsKey("updated_at"))) { comment.UpdatedAt = activity.OccurredAt; } foundObjects.Add(comment); break; } case ResourceKind.Task: { Dictionary<string, object> values; if (!accumulatedCommentValues.TryGetValue(change.Id, out values)) { values = accumulatedCommentValues[change.Id] = new Dictionary<string, object>(); } if (change.NewValues != null) change.NewValues.ToList().ForEach(kp => values[kp.Key] = kp.Value); else if (change.OriginalValues != null) change.OriginalValues.ToList().ForEach(kp => values[kp.Key] = kp.Value); var task = deserializer.Deserialize<Task>(values); if (activity.OccurredAt != DateTimeOffset.MinValue || (change.NewValues != null && !change.NewValues.ContainsKey("updated_at"))) { task.UpdatedAt = activity.OccurredAt; } foundObjects.Add(task); break; } case ResourceKind.Label: { Dictionary<string, object> values; if (!accumulatedLabelValues.TryGetValue(change.Id, out values)) { values = accumulatedLabelValues[change.Id] = new Dictionary<string, object>(); } if (change.NewValues != null) change.NewValues.ToList().ForEach(kp => values[kp.Key] = kp.Value); else if (change.OriginalValues != null) change.OriginalValues.ToList().ForEach(kp => values[kp.Key] = kp.Value); var label = deserializer.Deserialize<Label>(values); if (activity.OccurredAt != DateTimeOffset.MinValue || (change.NewValues != null && !change.NewValues.ContainsKey("updated_at"))) { label.UpdatedAt = activity.OccurredAt; } foundObjects.Add(label); break; } default: throw new Exception("Unhandled resource kind: " + change.Kind); } } } Assert.IsNotEmpty(foundObjects); Assert.AreEqual(4, foundObjects.Where(o => o is Story).Count()); Assert.AreEqual(2, foundObjects.Where(o => o is Comment).Count()); Assert.AreEqual(2, foundObjects.Where(o => o is Task).Count()); Assert.AreEqual(2, foundObjects.Where(o => o is Label).Count()); }
public void CanAddGetAndDeleteNewTasks() { var story = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId }; var savedStory = this.storyService.AddNewStory(Constants.ProjectId, story); var task = new Task { Description = "stuff stuff stuff", StoryId = savedStory.Id, ProjectId = Constants.ProjectId }; var savedTask = this.storyService.AddNewTask(task); Assert.AreEqual(task.Description, savedTask.Description); var retrievedTask = this.storyService.GetTask(Constants.ProjectId, savedTask.StoryId, savedTask.Id); Assert.NotNull(retrievedTask); Assert.IsTrue(this.storyService.RemoveTask(retrievedTask.ProjectId, task.StoryId, retrievedTask.Id)); }
public void CanUpdateStory() { var story = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId, Estimate = 2 }; var savedStory = this.storyService.AddNewStory(Constants.ProjectId, story); savedStory.Name = "Call be New name"; savedStory.Description = "wololo"; savedStory.Estimate = 1; savedStory.Labels = new List<Label> { "laby hh", "pool" }; var updatedStory = this.storyService.UpdateStory(Constants.ProjectId, savedStory); VerifyStory(savedStory, updatedStory); }
public void CanRetrieveIceBoxStories() { var story = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId, CurrentState = StoryStatus.Unscheduled, Estimate = 2 }; var savedStory = this.storyService.AddNewStory(Constants.ProjectId, story); System.Threading.Thread.Sleep(5000); // There is a lag in pivotal tracker's filter search. removing the slepp will cause the test to fail occasionally var stories = this.storyService.GetIceboxStories(Constants.ProjectId); Assert.NotNull(stories); Assert.AreEqual(1, stories.Count); Assert.AreEqual(savedStory.Id, stories[0].Id); }
public void CanGetAllStoriesMatchingFilter_Strict() { var story1 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Bug, Description = "some story", ProjectId = Constants.ProjectId }; var story2 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "another story", ProjectId = Constants.ProjectId }; var story3 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "yet another story", ProjectId = Constants.ProjectId }; var savedStory = this.storyService.AddNewStory(Constants.ProjectId, story1); savedStory.Labels = new List<Label> { "5.1.30", "plume" }; savedStory = this.storyService.UpdateStory(Constants.ProjectId, savedStory); this.storyService.AddNewStory(Constants.ProjectId, story2); this.storyService.AddNewStory(Constants.ProjectId, story3); System.Threading.Thread.Sleep(5000); // There is a lag in pivotal tracker's filter search. removing the slepp will cause the test to fail occasionally var stories = this.storyService.GetAllStoriesMatchingFilter(Constants.ProjectId, FilteringCriteria.FilterBy.Label("5.1.30").Type(StoryType.Bug)); Assert.NotNull(stories); Assert.AreEqual(1, stories.Count); Assert.AreEqual(savedStory.Id, stories[0].Id); }
public List<Task> GetTasksForStory(int projectId, Story story) { return this.GetTasksForStory(projectId, story.Id); }
public Story UpdateStory(int projectId, Story story) { var request = BuildPutRequest(); request.Resource = string.Format(SingleStoryEndpoint, projectId, story.Id); request.AddParameter("application/json", story.ToJson(), ParameterType.RequestBody); return RestClient.ExecuteRequestWithChecks<Story>(request); }
public Story AddNewStory(int projectId, Story toBeSaved) { var request = BuildPostRequest(); request.Resource = string.Format(StoriesEndpoint, projectId); request.AddParameter("application/json", toBeSaved.ToJson(), ParameterType.RequestBody); return RestClient.ExecuteRequestWithChecks<Story>(request); }
public string GenerateXmlDiff(Story story) { return(Id != story.Id ? string.Empty : new XElement("story", BuildDiffs(story)).ToString(SaveOptions.DisableFormatting)); }
public Story UpdateStory(int projectId, Story story) { var toBeUpdated = FindStory(projectId, story.Id); var request = BuildPutRequest(); request.Resource = string.Format(SingleStoryEndpoint, projectId, story.Id); request.AddParameter("application/xml", toBeUpdated.GenerateXmlDiff(story), ParameterType.RequestBody); var response = RestClient.Execute<Story>(request); return response.Data; }
public Story AddNewStory(int projectId, Story toBeSaved) { var request = BuildPostRequest(); request.Resource = string.Format(StoriesEndpoint, projectId); request.AddParameter("application/xml", toBeSaved.ToXml(), ParameterType.RequestBody); var response = RestClient.Execute<Story>(request); return response.Data; }
public void CanGetAllStoriesMatchingFilter_FreeForm() { var story1 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Bug, Description = "some story", ProjectId = Constants.ProjectId }; var story2 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "another story", ProjectId = Constants.ProjectId }; var story3 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "yet another story", ProjectId = Constants.ProjectId }; var savedStory = this.storyService.AddNewStory(Constants.ProjectId, story1); this.storyService.AddNewStory(Constants.ProjectId, story2); this.storyService.AddNewStory(Constants.ProjectId, story3); System.Threading.Thread.Sleep(5000); // There is a lag in pivotal tracker's filter search. removing the slepp will cause the test to fail occasionally var stories = this.storyService.GetAllStoriesMatchingFilter(Constants.ProjectId, "type:bug requester:\"pivotaltrackerdotnet\""); Assert.NotNull(stories); Assert.AreEqual(1, stories.Count); Assert.AreEqual(savedStory.Id, stories[0].Id); }
public void CanGetAllStoriesMatchingFilter_WithFields() { var story1 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Bug, Description = "some story", ProjectId = Constants.ProjectId }; var story2 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "another story", ProjectId = Constants.ProjectId }; var story3 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "yet another story", ProjectId = Constants.ProjectId }; var savedStory = this.storyService.AddNewStory(Constants.ProjectId, story1); this.storyService.AddNewStory(Constants.ProjectId, story2); this.storyService.AddNewStory(Constants.ProjectId, story3); this.storyService.AddNewTask(new Task { Description = "stuff stuff stuff", StoryId = savedStory.Id, ProjectId = Constants.ProjectId }); this.storyService.AddComment(Constants.ProjectId, savedStory.Id, "A comment"); System.Threading.Thread.Sleep(5000); // There is a lag in pivotal tracker's filter search. removing the slepp will cause the test to fail occasionally var stories = this.storyService.GetAllStoriesMatchingFilter( Constants.ProjectId, "type:bug requester:\"pivotaltrackerdotnet\"", StoryIncludeFields.Owners | StoryIncludeFields.OwnerIds | StoryIncludeFields.Followers | StoryIncludeFields.FollowerIds | StoryIncludeFields.Comments | StoryIncludeFields.Tasks | StoryIncludeFields.RequestedBy); Assert.NotNull(stories); Assert.AreEqual(1, stories.Count); Assert.AreEqual(savedStory.Id, stories[0].Id); Assert.NotNull(stories[0].Followers); Assert.NotNull(stories[0].Comments); Assert.NotNull(stories[0].Tasks); Assert.Greater(stories[0].Followers.Count, 0); Assert.Greater(stories[0].Comments.Count, 0); Assert.Greater(stories[0].Tasks.Count, 0); Assert.NotNull(stories[0].RequestedBy); }
public void Finish() { var mockery = new MockRepository(); var storyService = mockery.StrictMock<IStoryService>(); var storyId = 1; var projectId = 3; var anotherStory = new Story() { CurrentState = StoryStatus.Finished }; using (mockery.Record()) { Expect.Call(storyService.FinishStory(projectId, storyId)).Return(anotherStory); } using (mockery.Playback()) { var controller = new StoriesController(storyService); var result = controller.Finish(projectId, storyId); var viewResult = result as PartialViewResult; Assert.NotNull(viewResult); Assert.IsInstanceOf<StoryRowViewModel>(viewResult.Model); Assert.AreEqual(((StoryRowViewModel)viewResult.Model).Story, anotherStory); } }
public void CanGetAllStoriesMatchingFilterCreatedSince_Strict() { var story1 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Bug, Description = "some story", ProjectId = Constants.ProjectId }; var story2 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "another story", ProjectId = Constants.ProjectId }; var story3 = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "yet another story", ProjectId = Constants.ProjectId }; var savedStory1 = this.storyService.AddNewStory(Constants.ProjectId, story1); savedStory1.Labels = new List<Label> { "5.1.30", "plume" }; savedStory1 = this.storyService.UpdateStory(Constants.ProjectId, savedStory1); var savedStory2 = this.storyService.AddNewStory(Constants.ProjectId, story2); var savedStory3 = this.storyService.AddNewStory(Constants.ProjectId, story3); System.Threading.Thread.Sleep(5000); // There is a lag in pivotal tracker's filter search. removing the slepp will cause the test to fail occasionally var stories = this.storyService.GetAllStoriesMatchingFilter(Constants.ProjectId, FilteringCriteria.FilterBy.CreatedSince(new DateTime(2008, 1, 1))); Assert.NotNull(stories); Assert.AreEqual(3, stories.Count); var savedIds = new[] { savedStory1.Id, savedStory2.Id, savedStory3.Id }.OrderBy(i => i).ToArray(); var storyIds = stories.Select(s => s.Id).OrderBy(i => i).ToArray(); Assert.IsTrue(storyIds.SequenceEqual(savedIds)); }
public void CanAddAndDeleteStores() { var story = new Story { Name = "Nouvelle histoire", RequestedBy = "pivotaltrackerdotnet", StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId, Estimate = 9 }; var savedStory = storyService.AddNewStory(Constants.ProjectId, story); Assert.AreEqual(story.Name, savedStory.Name); Assert.AreEqual(Constants.ProjectId, savedStory.ProjectId); Assert.AreEqual(story.RequestedBy, savedStory.RequestedBy); Assert.AreEqual(story.StoryType, savedStory.StoryType); Assert.AreEqual(story.Description, savedStory.Description); //Assert.AreEqual(9, expected.Estimate); var deletedStory = storyService.RemoveStory(Constants.ProjectId, savedStory.Id); VerifyStory(savedStory, deletedStory); }
public void CanAddAndDeleteStories() { var story = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId, Estimate = 2 }; var savedStory = this.storyService.AddNewStory(Constants.ProjectId, story); Assert.AreEqual(story.Name, savedStory.Name); Assert.AreEqual(Constants.ProjectId, savedStory.ProjectId); Assert.AreEqual(story.RequestedById, savedStory.RequestedById); Assert.AreEqual(story.StoryType, savedStory.StoryType); Assert.AreEqual(story.Description, savedStory.Description); Assert.AreEqual(2, savedStory.Estimate); this.storyService.RemoveStory(Constants.ProjectId, savedStory.Id); }
public void CanUpdateStory() { var story = new Story { Name = "Nouvelle histoire", RequestedBy = "pivotaltrackerdotnet", StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId, Estimate = 9 }; var savedStory = storyService.AddNewStory(Constants.ProjectId, story); savedStory.Name = "Call be New name"; savedStory.Description = "wololo"; savedStory.Estimate = 1; savedStory.Labels = "laby hh,pool"; var updatedStory = storyService.UpdateStory(Constants.ProjectId, savedStory); VerifyStory(savedStory, updatedStory); }
public void CanSaveTask() { var story = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId }; var savedStory = this.storyService.AddNewStory(Constants.ProjectId, story); var task = this.storyService.AddNewTask(new Task { Description = "stuff stuff stuff", StoryId = savedStory.Id, ProjectId = Constants.ProjectId }); var guid = Guid.NewGuid().ToString(); task.Description = guid; var savedTask = this.storyService.SaveTask(task); Assert.AreEqual(task.Description, savedTask.Description); Assert.AreEqual(task.ProjectId, savedTask.ProjectId); Assert.AreEqual(task.StoryId, savedTask.StoryId); var tasks = this.storyService.GetTasksForStory(Constants.ProjectId, savedStory); Assert.AreEqual(guid, tasks[0].Description); }
public void CanSaveTask() { var story = new Story { Name = "Nouvelle histoire", RequestedBy = "pivotaltrackerdotnet", StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId }; var savedStory = storyService.AddNewStory(Constants.ProjectId, story); var task = storyService.AddNewTask(new Task { Description = "stuff stuff stuff", ParentStoryId = savedStory.Id, ProjectId = Constants.ProjectId }); var guid = Guid.NewGuid().ToString(); task.Description = guid; storyService.SaveTask(task); var stories = storyService.GetAllStories(Constants.ProjectId); Assert.AreEqual(guid, stories[0].Tasks[0].Description); }
public void CanGetAllIterationsWithStoryFields() { var story = new Story { Name = "Nouvelle histoire", RequestedById = Constants.UserId, StoryType = StoryType.Feature, Description = "bla bla bla and more bla", ProjectId = Constants.ProjectId, Deadline = DateTimeOffset.Now, CurrentState = StoryStatus.Unstarted }; var savedStory = this.storyService.AddNewStory(Constants.ProjectId, story); var task = this.storyService.AddNewTask(new Task { Description = "stuff stuff stuff", StoryId = savedStory.Id, ProjectId = Constants.ProjectId }); this.storyService.AddComment(Constants.ProjectId, savedStory.Id, "A comment"); var iterations = this.storyService.GetAllIterations(Constants.ProjectId, StoryIncludeFields.Owners | StoryIncludeFields.OwnerIds | StoryIncludeFields.Followers | StoryIncludeFields.FollowerIds | StoryIncludeFields.Comments | StoryIncludeFields.Tasks | StoryIncludeFields.RequestedBy); Assert.Greater(iterations.Count, 0); Assert.NotNull(iterations[0].Start); Assert.NotNull(iterations[0].Stories); Assert.Greater(iterations[0].Stories.Count, 0); Assert.NotNull(iterations[0].Stories[0].Followers); Assert.NotNull(iterations[0].Stories[0].Comments); Assert.NotNull(iterations[0].Stories[0].Tasks); Assert.Greater(iterations[0].Stories[0].Followers.Count, 0); Assert.Greater(iterations[0].Stories[0].Comments.Count, 0); Assert.Greater(iterations[0].Stories[0].Tasks.Count, 0); Assert.NotNull(iterations[0].Stories[0].RequestedBy); }
public StoryRowViewModel(Story story) { Story = story; }
private static void VerifyStory(Story expected, Story actual) { Assert.AreEqual(expected.Id, actual.Id); Assert.AreEqual(expected.Name, actual.Name); Assert.AreEqual(Constants.ProjectId, actual.ProjectId); Assert.AreEqual(expected.RequestedById, actual.RequestedById); Assert.AreEqual(expected.StoryType, actual.StoryType); Assert.AreEqual(expected.Description, actual.Description); Assert.AreEqual(expected.Estimate, actual.Estimate); Assert.AreEqual(expected.Labels.Count, actual.Labels.Count); Assert.AreEqual(expected.Labels, actual.Labels); }
Story GetStoryWithTasks(int projectId, Story story) { var request = BuildGetRequest(); request.Resource = string.Format(TaskEndpoint, projectId, story.Id); var taskResponse = RestClient.Execute<List<Task>>(request); story.Tasks = taskResponse.Data; if (story.Tasks != null) { story.Tasks.ForEach(e => { e.ParentStoryId = story.Id; e.ProjectId = projectId; }); } return story; }