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

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

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

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

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

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

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