1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-03-17 20:47:57 +02:00

fix some posible nil reference

This commit is contained in:
ahmadsalimi 2021-02-08 04:02:36 +03:30
parent 3017996765
commit a4fbf264e7
2 changed files with 7 additions and 21 deletions

View File

@ -22,9 +22,7 @@ func TestOrganizationService_GetAllOrganizationsWithContext(t *testing.T) {
if result == nil {
t.Error("Expected Organizations. Result is nil")
}
if result.Size != 1 {
} else if result.Size != 1 {
t.Errorf("Expected size to be 1, but got %d", result.Size)
}
@ -51,9 +49,7 @@ func TestOrganizationService_CreateOrganization(t *testing.T) {
if o == nil {
t.Error("Expected Organization. Result is nil")
}
if o.Name != name {
} else if o.Name != name {
t.Errorf("Expected name to be %s, but got %s", name, o.Name)
}
@ -82,9 +78,7 @@ func TestOrganizationService_GetOrganization(t *testing.T) {
if o == nil {
t.Error("Expected Organization. Result is nil")
}
if o.Name != "name" {
} else if o.Name != "name" {
t.Errorf("Expected name to be name, but got %s", o.Name)
}
}
@ -132,9 +126,7 @@ func TestOrganizationService_GetPropertiesKeys(t *testing.T) {
if pk == nil {
t.Error("Expected Keys. Result is nil")
}
if pk.Keys[0].Key != "organization.attributes" {
} else if pk.Keys[0].Key != "organization.attributes" {
t.Errorf("Expected name to be organization.attributes, but got %s", pk.Keys[0].Key)
}
}
@ -165,9 +157,7 @@ func TestOrganizationService_GetProperty(t *testing.T) {
if ep == nil {
t.Error("Expected Entity. Result is nil")
}
if ep.Key != key {
} else if ep.Key != key {
t.Errorf("Expected name to be %s, but got %s", key, ep.Key)
}
}
@ -279,9 +269,7 @@ func TestOrganizationService_GetUsers(t *testing.T) {
if users == nil {
t.Error("Expected Organizations. Result is nil")
}
if users.Size != 1 {
} else if users.Size != 1 {
t.Errorf("Expected size to be 1, but got %d", users.Size)
}

View File

@ -56,9 +56,7 @@ func TestServiceDeskService_GetOrganizations(t *testing.T) {
if orgs == nil {
t.Error("Expected Organizations. Result is nil")
}
if orgs.Size != 3 {
} else if orgs.Size != 3 {
t.Errorf("Expected size to be 3, but got %d", orgs.Size)
}