예제 #1
0
 static void PrintWorkItemStatus( WorkItemStatus status )
 {
     Console.WriteLine( "\nWorkItemStatus\n" );
      Console.WriteLine( "\tId: " + status.Id.ToString() );
      Console.WriteLine( "\tName: " + status.Name );
      Console.WriteLine( "\tDescription: " + status.Description );
      Console.WriteLine( "\tStatusCd: " + status.StatusCd );
      Console.WriteLine( "\tCagtegory: " + status.Category );
      Console.WriteLine( "\tIsPredefined: " + status.IsPredefined );
 }
예제 #2
0
        public void IsValid_IfExistingValidItem()
        {
            var item = new WorkItemStatus( _sessionFactory.Object )
             {
            Id = WorkItemStatuses.ModelData[0].Id,
            Name = WorkItemStatuses.ModelData[0].Name,
            Description = WorkItemStatuses.ModelData[0].Description,
            Category = WorkItemStatuses.ModelData[0].Category,
            SortSequence = WorkItemStatuses.ModelData[0].SortSequence,
            StatusCd = WorkItemStatuses.ModelData[0].StatusCd,
            IsPredefined = WorkItemStatuses.ModelData[0].IsPredefined
             };

             Assert.IsTrue( item.IsValidFor( TransactionType.All ) );
             var messages = item.GetErrorMessages();
             Assert.AreEqual( 0, messages.Count );
        }
예제 #3
0
        public void IsNotValid_IfDifferentItemWithSameNameExists()
        {
            var item = new WorkItemStatus( _sessionFactory.Object )
             {
            Id = Guid.NewGuid(),
            Name = WorkItemStatuses.ModelData[0].Name,
            Description = "This is just for testing",
            Category = WorkItemStatusCategory.InProcess,
            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 Status", item.Name ), messages["Name"] );
        }
예제 #4
0
 private static void InitializeWorkItemStatuses()
 {
     newWorkItem = WorkItemStatuses.ModelData.First( x => x.Name == "New" );
      planning = WorkItemStatuses.ModelData.First( x => x.Name == "Planning" );
      assigned = WorkItemStatuses.ModelData.First( x => x.Name == "Assigned" );
      complete = WorkItemStatuses.ModelData.First( x => x.Name == "Complete" );
      cancelled = WorkItemStatuses.ModelData.First( x => x.Name == "Cancelled" );
 }
예제 #5
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;
        }
예제 #6
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;
        }