private void SetupWorkItemList(out WorkItem workItem1, out WorkItem workItem3) { var user2 = new User { Id = Guid.NewGuid(), Username = "******" }; workItem1 = new WorkItem { Id = Guid.NewGuid(), Name = "Work Item 1", ProjectTaskType = new ProjectTaskType { Name = "Task Type 1" }, User = user }; startTime1 = new DateTime(2010, 1, 1); workItem1.TimeEntries.Add(new TimeEntry { StartTime = new DateTime(2009, 1, 1) }); workItem1.TimeEntries.Add(new TimeEntry { StartTime = startTime1 }); var workItem2 = new WorkItem { Id = Guid.NewGuid(), Name = "Work Item 2", ProjectTaskType = new ProjectTaskType { Name = "Task Type 2" }, User = user2 }; startTime2 = new DateTime(2010, 2, 1); workItem2.TimeEntries.Add(new TimeEntry { StartTime = startTime2 }); workItem3 = new WorkItem { Id = Guid.NewGuid(), Name = "Work Item 3", ProjectTaskType = new ProjectTaskType { Name = "Task Type 3" }, User = user }; var workItems = new List<WorkItem> { workItem1, workItem2, workItem3 }; repository.Stub(x => x.Query<WorkItem>()).Return(workItems.AsQueryable()).Repeat.Any(); }
private void AssertWorkItemsAreEqual(WorkItemListItem result, WorkItem item) { Assert.AreEqual(item.Id, result.Id); Assert.AreEqual(item.Name, result.Name); Assert.AreEqual(item.ProjectTaskType.Name, result.ProjectTaskTypeName); }
private void detach_WorkItems(WorkItem entity) { this.SendPropertyChanging(); entity.User = null; }
private void detach_WorkItems(WorkItem entity) { this.SendPropertyChanging(); entity.ProjectTaskType = null; }
private void attach_WorkItems(WorkItem entity) { this.SendPropertyChanging(); entity.User = this; }