コード例 #1
0
			rebooted, err := virtualGuestService.PowerCycle(virtualGuest.Id)
			Expect(err).To(HaveOccurred())
			Expect(rebooted).To(BeFalse())
		})
	})

	Context("#PowerOff", func() {
		BeforeEach(func() {
			virtualGuest.Id = 1234567
		})

		It("sucessfully power off virtual guest instance", func() {
			fakeClient.DoRawHttpRequestResponse = []byte("true")

			rebooted, err := virtualGuestService.PowerOff(virtualGuest.Id)
			Expect(err).ToNot(HaveOccurred())
			Expect(rebooted).To(BeTrue())
		})

		It("fails to power off virtual guest instance", func() {
			fakeClient.DoRawHttpRequestResponse = []byte("false")

			rebooted, err := virtualGuestService.PowerOff(virtualGuest.Id)
			Expect(err).To(HaveOccurred())
			Expect(rebooted).To(BeFalse())
		})
	})

	Context("#PowerOffSoft", func() {
		BeforeEach(func() {