コード例 #1
0
ファイル: WorkItems.cs プロジェクト: kensodemann/HomeScrum
        private static void AddAcceptanceCriteria( WorkItem workItem, string name, string description, AcceptanceCriterionStatus status )
        {
            var criterion = new AcceptanceCriterion()
             {
            WorkItem = workItem,
            Name = name,
            Description = description,
            Status = status
             };

             _criteria.Add( criterion );
        }
コード例 #2
0
        private static void CreateSnapshotEntry( WorkItem workItem, DateTime date, int points, int pointsRemaining, int sequence )
        {
            var entry = new WorkItemDailySnapshot()
             {
            HistoryDate = date,
            Points = points,
            PointsRemaining = pointsRemaining,
            SortSequenceNumber = sequence,
            WorkItem = workItem
             };

             _snapshotEntry.Add( entry );
        }
コード例 #3
0
        private static void CreateRandomHistory( WorkItem w )
        {
            //var rnd = new Random();
             var entries = rnd.Next( 1, 20 );
             var prevEntryTimestamp = DateTime.Now;

             for (var i = 0; i < entries; i++)
             {
            var ago = rnd.Next( 1, 960 );
            prevEntryTimestamp = prevEntryTimestamp.AddHours(-1 * ago);
            var user = Users.ModelData[rnd.Next( 0, Users.ModelData.Count() )];

            var entry = new WorkItemHistory()
            {
               HistoryTimestamp = prevEntryTimestamp,
               SequenceNumber = entries - i,
               LastModifiedUser = user,
               WorkItem = w
            };

            _workItemHistories.Add( entry );
             }
        }
コード例 #4
0
ファイル: WorkItems.cs プロジェクト: kensodemann/HomeScrum
        private static WorkItem CreateWorkItem( string name, string description, WorkItemType wit, WorkItemStatus status, Project project, int points = 1, int pointsRemaining = 0 )
        {
            var workItem = new WorkItem()
             {
            Name = name,
            Description = description,
            WorkItemType = wit,
            Status = status,
            CreatedByUser = GetRandomUser(),
            LastModifiedUserRid = GetRandomUser().Id,
            Project = project,
            Points = points,
            PointsRemaining = pointsRemaining
             };
             workItem.Tasks = new List<WorkItem>();
             workItem.PointsHistory = new List<WorkItemDailySnapshot>();
             _workItems.Add( workItem );

             return workItem;
        }
コード例 #5
0
ファイル: WorkItems.cs プロジェクト: kensodemann/HomeScrum
        private static WorkItem CreateChildTask( WorkItem backlogItem, string name, string description, WorkItemType wit, WorkItemStatus status, int points = 1, int pointsRemaining = 0 )
        {
            var workItem = new WorkItem()
             {
            ParentWorkItem = backlogItem,
            Name = name,
            Description = description,
            WorkItemType = wit,
            Status = status,
            Project = backlogItem.Project,
            CreatedByUser = backlogItem.CreatedByUser,
            LastModifiedUserRid = backlogItem.LastModifiedUserRid,
            Points = points,
            PointsRemaining = pointsRemaining
             };
             ((List<WorkItem>)backlogItem.Tasks).Add( workItem );
             workItem.PointsHistory = new List<WorkItemDailySnapshot>();
             _workItems.Add( workItem );

             return workItem;
        }
コード例 #6
0
ファイル: WorkItems.cs プロジェクト: kensodemann/HomeScrum
 private static void CloseCriteriaList( WorkItem workItem )
 {
     workItem.AcceptanceCriteria = _criteria.ToArray();
      _criteria = null;
 }
コード例 #7
0
 public void InitializeTest()
 {
     _translator = new WorkItemPropertyNameTranslator();
      _sourceObject = new WorkItem();
 }
コード例 #8
0
 private WorkItemEditorViewModel CreateWorkItemEditorViewModel( WorkItem workItem )
 {
     return new WorkItemEditorViewModel()
      {
     Id = workItem.Id,
     Name = workItem.Name,
     Description = workItem.Description,
     StatusId = workItem.Status.Id,
     StatusName = workItem.Status.Name,
     WorkItemTypeId = workItem.WorkItemType.Id,
     WorkItemTypeName = workItem.WorkItemType.Name,
     AssignedToUserId = (workItem.AssignedToUser == null) ? default( Guid ) : workItem.AssignedToUser.Id,
     AssignedToUserUserName = (workItem.AssignedToUser == null) ? null : workItem.AssignedToUser.UserName,
     CreatedByUserId = workItem.CreatedByUser.Id,
     CreatedByUserUserName = workItem.CreatedByUser.UserName,
     ProjectId = (workItem.Project == null) ? default( Guid ) : workItem.Project.Id,
     ProjectName = (workItem.Project == null) ? null : workItem.Project.Name,
     ParentWorkItemId = (workItem.ParentWorkItem == null) ? default( Guid ) : workItem.ParentWorkItem.Id,
     ParentWorkItemName = (workItem.ParentWorkItem == null) ? null : workItem.ParentWorkItem.Name,
     SprintId = (workItem.Sprint == null) ? Guid.Empty : workItem.Sprint.Id,
     SprintName = (workItem.Sprint == null) ? null : workItem.Sprint.Name
      };
 }