package testing

import (
	"testing"

	"devel.mephi.ru/iacherepanov/openstack-gophercloud/openstack/compute/v2/extensions/startstop"
	th "devel.mephi.ru/iacherepanov/openstack-gophercloud/testhelper"
	"devel.mephi.ru/iacherepanov/openstack-gophercloud/testhelper/client"
)

const serverID = "{serverId}"

func TestStart(t *testing.T) {
	th.SetupHTTP()
	defer th.TeardownHTTP()

	mockStartServerResponse(t, serverID)

	err := startstop.Start(client.ServiceClient(), serverID).ExtractErr()
	th.AssertNoErr(t, err)
}

func TestStop(t *testing.T) {
	th.SetupHTTP()
	defer th.TeardownHTTP()

	mockStopServerResponse(t, serverID)

	err := startstop.Stop(client.ServiceClient(), serverID).ExtractErr()
	th.AssertNoErr(t, err)
}
