func TestLogServiceUpdate(t *testing.T) {  
	var result LogService
	err := json.NewDecoder(strings.NewReader(logServiceBody)).Decode(&result)
	if err != nil {
		t.Errorf("Error decoding JSON: %s", err)
	}
	testClient := &common.TestClient{}
	result.SetClient(testClient)
	result.ServiceEnabled = false
	err = result.Update()
	if err != nil {
		t.Errorf("Error making Update call: %s", err)
	}
	calls := testClient.CapturedCalls()
	if !strings.Contains(calls[0].Payload, "ServiceEnabled:false") {
		t.Errorf("Unexpected ServiceEnabled update payload: %s", calls[0].Payload)
	}
}
TestLogServiceUpdate tests the Update call.
package redfish
import (
	"encoding/json"
	"strings"
	"testing"
	"github.com/stmcginnis/gofish/common"
)
var logServiceBody = `{
		"@odata.context": "/redfish/v1/$metadata#LogService.LogService",
		"@odata.type": "#LogService.v1_0_0.LogService",
		"@odata.id": "/redfish/v1/LogService",
		"Id": "LogService-1",
		"Name": "LogServiceOne",
		"Description": "LogService One",
		"DateTime": "2012-03-07T14:44+06:00",
		"Entries": {
			"@odata.id": "/redfish/v1/LogEntryCollection"
		},
		"LogEntryType": "Event",
		"MaxNumberOfRecords": 1000,
		"OverWritePolicy": "WrapsWhenFull",
		"ServiceEnabled": true,
		"Status": {
			"State": "Enabled",
			"Health": "OK"
		},
		"Actions": {
			"#LogService.ClearLog": {
				"target": "/redfish/v1/Managers/BMC/LogServices/Log/Actions/LogService.ClearLog"
			}
		}
	}`
func TestLogService(t *testing.T) {
	var result LogService
	err := json.NewDecoder(strings.NewReader(logServiceBody)).Decode(&result)
	if err != nil {
		t.Errorf("Error decoding JSON: %s", err)
	}
	if result.ID != "LogService-1" {
		t.Errorf("Received invalid ID: %s", result.ID)
	}
	if result.Name != "LogServiceOne" {
		t.Errorf("Received invalid name: %s", result.Name)
	}
	if result.entries != "/redfish/v1/LogEntryCollection" {
		t.Errorf("Received invalid log entry collection: %s", result.entries)
	}
	if result.LogEntryType != EventLogEntryTypes {
		t.Errorf("Received %s log entry type", result.LogEntryType)
	}
	if result.MaxNumberOfRecords != 1000 {
		t.Errorf("Received %d max number of records", result.MaxNumberOfRecords)
	}
	if result.OverWritePolicy != WrapsWhenFullOverWritePolicy {
		t.Errorf("Received %s overwrite policy", result.OverWritePolicy)
	}
	if !result.ServiceEnabled {
		t.Error("Service should be enabled")
	}
	if result.clearLogTarget != "/redfish/v1/Managers/BMC/LogServices/Log/Actions/LogService.ClearLog" {
		t.Errorf("Invalid ClearLog target: %s", result.clearLogTarget)
	}
}