1
0
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:
Bidesh Thapaliya
2016-09-27 11:54:09 +02:00
parent f2937d6875
commit 435fdb84eb

View File

@@ -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
}
}