mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-09-16 09:06:19 +02:00
Adds test for GetProjectWithName and GetIssueTypeWithName
This commit is contained in:
@@ -442,3 +442,31 @@ func TestMetaIssueTypes_GetAllFields(t *testing.T) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestCreateMetaInfo_GetProjectName_Success(t *testing.T) {
|
||||
metainfo := new(CreateMetaInfo)
|
||||
metainfo.Projects = append(metainfo.Projects, &MetaProject{
|
||||
Name: "SOP",
|
||||
})
|
||||
|
||||
project := metainfo.GetProjectWithName("SOP")
|
||||
if project == nil {
|
||||
t.Errorf("Expected non nil value, recieved nil")
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestMetaProject_GetIssueTypeWithName_CaseMismatch_Success(t *testing.T) {
|
||||
m := new(MetaProject)
|
||||
m.IssueTypes = append(m.IssueTypes, &MetaIssueTypes{
|
||||
Name: "Bug",
|
||||
})
|
||||
|
||||
issuetype := m.GetIssueTypeWithName("BUG")
|
||||
|
||||
if issuetype == nil {
|
||||
t.Errorf("Expected non nil value, recieved nil")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user