// TestShowWorkItemLinkTypeOK tests if we can fetch the "system" work item link type
TestShowWorkItemLinkTypeOK tests if we can fetch the "system" work item link type
// TestShowWorkItemLinkTypeOK tests if we can fetch the " system " work item link type
func (s *workItemLinkTypeSuite) TestShowWorkItemLinkTypeOK() {
	createPayload := s.createDemoLinkType(s.linkTypeName)
	_, workItemLinkType := test.CreateWorkItemLinkTypeCreated(s.T(), s.svc.Context, s.svc, s.linkTypeCtrl, createPayload.Data.Relationships.Space.Data.ID.String(), createPayload)
	require.NotNil(s.T(), workItemLinkType)
	_, readIn := test.ShowWorkItemLinkTypeOK(s.T(), nil, nil, s.linkTypeCtrl, createPayload.Data.Relationships.Space.Data.ID.String(), workItemLinkType.Data.ID.String(), nil, nil)
	require.NotNil(s.T(), readIn)
	expected, err := ConvertWorkItemLinkTypeToModel(*workItemLinkType)
	require.Nil(s.T(), err)
	actual, err := ConvertWorkItemLinkTypeToModel(*readIn)
	require.Nil(s.T(), err)
	require.Equal(s.T(), expected.ID, actual.ID)
	require.Len(s.T(), readIn.Included, 2, "The work item link type should include it's work item link category and space.")
	categoryData, ok := readIn.Included[0].(*app.WorkItemLinkCategoryData)
	require.True(s.T(), ok)
	require.Equal(s.T(), s.categoryName, *categoryData.Attributes.Name, "The work item link type's category should have the name 'test-user'.")
	spaceData, ok := readIn.Included[1].(*app.Space)
	require.True(s.T(), ok)
	require.Equal(s.T(), s.spaceName, *spaceData.Attributes.Name, "The work item link type's space should have the name 'test-space'.")
	require.NotNil(s.T(), readIn.Data.Links, "The link type MUST include a self link")
	require.NotEmpty(s.T(), readIn.Data.Links.Self, "The link type MUST include a self link that's not empty")
}
func ( s * workItemLinkTypeSuite ) TestShowWorkItemLinkTypeOK ( ) { createPayload := s . createDemoLinkType ( s . linkTypeName ) _ , workItemLinkType := test . CreateWorkItemLinkTypeCreated ( s . T ( ) , s . svc . Context , s . svc , s . linkTypeCtrl , createPayload . Data . Relationships . Space . Data . ID . String ( ) , createPayload ) require . NotNil ( s . T ( ) , workItemLinkType ) _ , readIn := test . ShowWorkItemLinkTypeOK ( s . T ( ) , nil , nil , s . linkTypeCtrl , createPayload . Data . Relationships . Space . Data . ID . String ( ) , workItemLinkType . Data . ID . String ( ) , nil , nil ) require . NotNil ( s . T ( ) , readIn ) expected , err := ConvertWorkItemLinkTypeToModel ( * workItemLinkType ) require . Nil ( s . T ( ) , err ) actual , err := ConvertWorkItemLinkTypeToModel ( * readIn ) require . Nil ( s . T ( ) , err ) require . Equal ( s . T ( ) , expected . ID , actual . ID ) require . Len ( s . T ( ) , readIn . Included , 2 , " " ) categoryData , ok := readIn . Included [ 0 ] . ( * app . WorkItemLinkCategoryData ) require . True ( s . T ( ) , ok ) require . Equal ( s . T ( ) , s . categoryName , * categoryData . Attributes . Name , " " ) spaceData , ok := readIn . Included [ 1 ] . ( * app . Space ) require . True ( s . T ( ) , ok ) require . Equal ( s . T ( ) , s . spaceName , * spaceData . Attributes . Name , " " ) require . NotNil ( s . T ( ) , readIn . Data . Links , " " ) require . NotEmpty ( s . T ( ) , readIn . Data . Links . Self , " " ) }
TestShowWorkItemLinkTypeOK tests if we can fetch the "system" work item link type
TestShowWorkItemLinkTypeOK tests if we can fetch the " system " work item link type
// Create the work item link type first and try to read it back in // Convert to domain model and use equal function // Check that the link category is included in the response in the "included" array // Check that the link space is included in the response in the "included" array