Пример #1
0
 static void PrintWorkItemType( WorkItemType workItemType )
 {
     Console.WriteLine( "\nWorkItemType\n" );
      Console.WriteLine( "\tId: " + workItemType.Id.ToString() );
      Console.WriteLine( "\tName: " + workItemType.Name );
      Console.WriteLine( "\tDescription: " + workItemType.Description );
      Console.WriteLine( "\tStatusCd: " + workItemType.StatusCd );
      Console.WriteLine( "\tCategory: " + workItemType.Category.ToString() );
      Console.WriteLine( "\tIsPredefined: " + workItemType.IsPredefined );
 }
Пример #2
0
        public void IsNotValid_IfDifferentItemWithSameNameExists()
        {
            var item = new WorkItemType( _sessionFactory.Object )
             {
            Id = Guid.NewGuid(),
            Name = WorkItemTypes.ModelData[0].Name,
            Description = "This is just for testing",
            Category = WorkItemTypeCategory.Task,
            SortSequence = 0,
            StatusCd = 'A',
            IsPredefined = false
             };

             Assert.IsFalse( item.IsValidFor( TransactionType.All ) );
             var messages = item.GetErrorMessages();
             Assert.AreEqual( 1, messages.Count );
             Assert.AreEqual( String.Format( ErrorMessages.NameIsNotUnique, "Work Item Type", item.Name ), messages["Name"] );
        }
Пример #3
0
 private static void InitializeWorkItemTypes()
 {
     pbi = WorkItemTypes.ModelData.First( x => x.Name == "PBI" );
      customerRequest = WorkItemTypes.ModelData.First( x => x.Name == "CR" );
      bug = WorkItemTypes.ModelData.First( x => x.Name == "Bug" );
      issue = WorkItemTypes.ModelData.First( x => x.Name == "Issue" );
      sbi = WorkItemTypes.ModelData.First( x => x.Name == "SBI" );
 }
Пример #4
0
        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
        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;
        }