mirror of
				https://github.com/interviewstreet/go-jira.git
				synced 2025-10-30 23:47:46 +02:00 
			
		
		
		
	fix some posible nil reference
This commit is contained in:
		| @@ -22,9 +22,7 @@ func TestOrganizationService_GetAllOrganizationsWithContext(t *testing.T) { | |||||||
|  |  | ||||||
| 	if result == nil { | 	if result == nil { | ||||||
| 		t.Error("Expected Organizations. Result is nil") | 		t.Error("Expected Organizations. Result is nil") | ||||||
| 	} | 	} else if result.Size != 1 { | ||||||
|  |  | ||||||
| 	if result.Size != 1 { |  | ||||||
| 		t.Errorf("Expected size to be 1, but got %d", result.Size) | 		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 { | 	if o == nil { | ||||||
| 		t.Error("Expected Organization. Result is nil") | 		t.Error("Expected Organization. Result is nil") | ||||||
| 	} | 	} else if o.Name != name { | ||||||
|  |  | ||||||
| 	if o.Name != name { |  | ||||||
| 		t.Errorf("Expected name to be %s, but got %s", name, o.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 { | 	if o == nil { | ||||||
| 		t.Error("Expected Organization. Result is nil") | 		t.Error("Expected Organization. Result is nil") | ||||||
| 	} | 	} else if o.Name != "name" { | ||||||
|  |  | ||||||
| 	if o.Name != "name" { |  | ||||||
| 		t.Errorf("Expected name to be name, but got %s", o.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 { | 	if pk == nil { | ||||||
| 		t.Error("Expected Keys. Result is nil") | 		t.Error("Expected Keys. Result is nil") | ||||||
| 	} | 	} else if pk.Keys[0].Key != "organization.attributes" { | ||||||
|  |  | ||||||
| 	if pk.Keys[0].Key != "organization.attributes" { |  | ||||||
| 		t.Errorf("Expected name to be organization.attributes, but got %s", pk.Keys[0].Key) | 		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 { | 	if ep == nil { | ||||||
| 		t.Error("Expected Entity. Result is nil") | 		t.Error("Expected Entity. Result is nil") | ||||||
| 	} | 	} else if ep.Key != key { | ||||||
|  |  | ||||||
| 	if ep.Key != key { |  | ||||||
| 		t.Errorf("Expected name to be %s, but got %s", key, ep.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 { | 	if users == nil { | ||||||
| 		t.Error("Expected Organizations. Result is nil") | 		t.Error("Expected Organizations. Result is nil") | ||||||
| 	} | 	} else if users.Size != 1 { | ||||||
|  |  | ||||||
| 	if users.Size != 1 { |  | ||||||
| 		t.Errorf("Expected size to be 1, but got %d", users.Size) | 		t.Errorf("Expected size to be 1, but got %d", users.Size) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -56,9 +56,7 @@ func TestServiceDeskService_GetOrganizations(t *testing.T) { | |||||||
|  |  | ||||||
| 	if orgs == nil { | 	if orgs == nil { | ||||||
| 		t.Error("Expected Organizations. Result is nil") | 		t.Error("Expected Organizations. Result is nil") | ||||||
| 	} | 	} else if orgs.Size != 3 { | ||||||
|  |  | ||||||
| 	if orgs.Size != 3 { |  | ||||||
| 		t.Errorf("Expected size to be 3, but got %d", orgs.Size) | 		t.Errorf("Expected size to be 3, but got %d", orgs.Size) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user