It("fails to order an iSCSI volume", func() { volume, err = networkStorageService.CreateNetworkStorage(20, 1000, "fake-location", true) Expect(err).To(HaveOccurred()) }) }) }) Context("#GetBillingItem", func() { BeforeEach(func() { fakeClient.FakeHttpClient.DoRawHttpRequestResponse, err = testhelpers.ReadJsonTestFixtures("services", "SoftLayer_Network_Storage_Service_getBillingItem.json") Expect(err).ToNot(HaveOccurred()) }) It("returns the billing item object based on volume id", func() { billingItem, err = networkStorageService.GetBillingItem(1) Expect(err).ToNot(HaveOccurred()) Expect(billingItem.Id).To(Equal(12345678)) }) Context("when HTTP client returns error codes 40x or 50x", func() { It("fails for error code 40x", func() { errorCodes := []int{400, 401, 499} for _, errorCode := range errorCodes { fakeClient.FakeHttpClient.DoRawHttpRequestInt = errorCode _, err = networkStorageService.GetBillingItem(1) Expect(err).To(HaveOccurred()) } })