// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1api20211101

import (
	"encoding/json"
	storage "github.com/Azure/azure-service-operator/v2/api/sql/v1api20211101/storage"
	"github.com/google/go-cmp/cmp"
	"github.com/google/go-cmp/cmp/cmpopts"
	"github.com/kr/pretty"
	"github.com/kylelemons/godebug/diff"
	"github.com/leanovate/gopter"
	"github.com/leanovate/gopter/gen"
	"github.com/leanovate/gopter/prop"
	"os"
	"reflect"
	"testing"
)

func Test_ServersDatabasesAdvancedThreatProtectionSetting_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	parameters.MinSuccessfulTests = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersDatabasesAdvancedThreatProtectionSetting to hub returns original",
		prop.ForAll(RunResourceConversionTestForServersDatabasesAdvancedThreatProtectionSetting, ServersDatabasesAdvancedThreatProtectionSettingGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunResourceConversionTestForServersDatabasesAdvancedThreatProtectionSetting tests if a specific instance of ServersDatabasesAdvancedThreatProtectionSetting round trips to the hub storage version and back losslessly
func RunResourceConversionTestForServersDatabasesAdvancedThreatProtectionSetting(subject ServersDatabasesAdvancedThreatProtectionSetting) string {
	// Copy subject to make sure conversion doesn't modify it
	copied := subject.DeepCopy()

	// Convert to our hub version
	var hub storage.ServersDatabasesAdvancedThreatProtectionSetting
	err := copied.ConvertTo(&hub)
	if err != nil {
		return err.Error()
	}

	// Convert from our hub version
	var actual ServersDatabasesAdvancedThreatProtectionSetting
	err = actual.ConvertFrom(&hub)
	if err != nil {
		return err.Error()
	}

	// Compare actual with what we started with
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_ServersDatabasesAdvancedThreatProtectionSetting_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersDatabasesAdvancedThreatProtectionSetting to ServersDatabasesAdvancedThreatProtectionSetting via AssignProperties_To_ServersDatabasesAdvancedThreatProtectionSetting & AssignProperties_From_ServersDatabasesAdvancedThreatProtectionSetting returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSetting, ServersDatabasesAdvancedThreatProtectionSettingGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSetting tests if a specific instance of ServersDatabasesAdvancedThreatProtectionSetting can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSetting(subject ServersDatabasesAdvancedThreatProtectionSetting) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.ServersDatabasesAdvancedThreatProtectionSetting
	err := copied.AssignProperties_To_ServersDatabasesAdvancedThreatProtectionSetting(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersDatabasesAdvancedThreatProtectionSetting
	err = actual.AssignProperties_From_ServersDatabasesAdvancedThreatProtectionSetting(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_ServersDatabasesAdvancedThreatProtectionSetting_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 20
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of ServersDatabasesAdvancedThreatProtectionSetting via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSetting, ServersDatabasesAdvancedThreatProtectionSettingGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSetting runs a test to see if a specific instance of ServersDatabasesAdvancedThreatProtectionSetting round trips to JSON and back losslessly
func RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSetting(subject ServersDatabasesAdvancedThreatProtectionSetting) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual ServersDatabasesAdvancedThreatProtectionSetting
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of ServersDatabasesAdvancedThreatProtectionSetting instances for property testing - lazily instantiated by
// ServersDatabasesAdvancedThreatProtectionSettingGenerator()
var serversDatabasesAdvancedThreatProtectionSettingGenerator gopter.Gen

// ServersDatabasesAdvancedThreatProtectionSettingGenerator returns a generator of ServersDatabasesAdvancedThreatProtectionSetting instances for property testing.
func ServersDatabasesAdvancedThreatProtectionSettingGenerator() gopter.Gen {
	if serversDatabasesAdvancedThreatProtectionSettingGenerator != nil {
		return serversDatabasesAdvancedThreatProtectionSettingGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddRelatedPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting(generators)
	serversDatabasesAdvancedThreatProtectionSettingGenerator = gen.Struct(reflect.TypeOf(ServersDatabasesAdvancedThreatProtectionSetting{}), generators)

	return serversDatabasesAdvancedThreatProtectionSettingGenerator
}

// AddRelatedPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting(gens map[string]gopter.Gen) {
	gens["Spec"] = ServersDatabasesAdvancedThreatProtectionSetting_SpecGenerator()
	gens["Status"] = ServersDatabasesAdvancedThreatProtectionSetting_STATUSGenerator()
}

func Test_ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec to ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec via AssignProperties_To_ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec & AssignProperties_From_ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSettingOperatorSpec, ServersDatabasesAdvancedThreatProtectionSettingOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSettingOperatorSpec tests if a specific instance of ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSettingOperatorSpec(subject ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec
	err := copied.AssignProperties_To_ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec
	err = actual.AssignProperties_From_ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 100
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSettingOperatorSpec, ServersDatabasesAdvancedThreatProtectionSettingOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSettingOperatorSpec runs a test to see if a specific instance of ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec round trips to JSON and back losslessly
func RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSettingOperatorSpec(subject ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec instances for property testing - lazily
// instantiated by ServersDatabasesAdvancedThreatProtectionSettingOperatorSpecGenerator()
var serversDatabasesAdvancedThreatProtectionSettingOperatorSpecGenerator gopter.Gen

// ServersDatabasesAdvancedThreatProtectionSettingOperatorSpecGenerator returns a generator of ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec instances for property testing.
func ServersDatabasesAdvancedThreatProtectionSettingOperatorSpecGenerator() gopter.Gen {
	if serversDatabasesAdvancedThreatProtectionSettingOperatorSpecGenerator != nil {
		return serversDatabasesAdvancedThreatProtectionSettingOperatorSpecGenerator
	}

	generators := make(map[string]gopter.Gen)
	serversDatabasesAdvancedThreatProtectionSettingOperatorSpecGenerator = gen.Struct(reflect.TypeOf(ServersDatabasesAdvancedThreatProtectionSettingOperatorSpec{}), generators)

	return serversDatabasesAdvancedThreatProtectionSettingOperatorSpecGenerator
}

func Test_ServersDatabasesAdvancedThreatProtectionSetting_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersDatabasesAdvancedThreatProtectionSetting_STATUS to ServersDatabasesAdvancedThreatProtectionSetting_STATUS via AssignProperties_To_ServersDatabasesAdvancedThreatProtectionSetting_STATUS & AssignProperties_From_ServersDatabasesAdvancedThreatProtectionSetting_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSetting_STATUS, ServersDatabasesAdvancedThreatProtectionSetting_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSetting_STATUS tests if a specific instance of ServersDatabasesAdvancedThreatProtectionSetting_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSetting_STATUS(subject ServersDatabasesAdvancedThreatProtectionSetting_STATUS) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.ServersDatabasesAdvancedThreatProtectionSetting_STATUS
	err := copied.AssignProperties_To_ServersDatabasesAdvancedThreatProtectionSetting_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersDatabasesAdvancedThreatProtectionSetting_STATUS
	err = actual.AssignProperties_From_ServersDatabasesAdvancedThreatProtectionSetting_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_ServersDatabasesAdvancedThreatProtectionSetting_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 80
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of ServersDatabasesAdvancedThreatProtectionSetting_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSetting_STATUS, ServersDatabasesAdvancedThreatProtectionSetting_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSetting_STATUS runs a test to see if a specific instance of ServersDatabasesAdvancedThreatProtectionSetting_STATUS round trips to JSON and back losslessly
func RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSetting_STATUS(subject ServersDatabasesAdvancedThreatProtectionSetting_STATUS) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual ServersDatabasesAdvancedThreatProtectionSetting_STATUS
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of ServersDatabasesAdvancedThreatProtectionSetting_STATUS instances for property testing - lazily
// instantiated by ServersDatabasesAdvancedThreatProtectionSetting_STATUSGenerator()
var serversDatabasesAdvancedThreatProtectionSetting_STATUSGenerator gopter.Gen

// ServersDatabasesAdvancedThreatProtectionSetting_STATUSGenerator returns a generator of ServersDatabasesAdvancedThreatProtectionSetting_STATUS instances for property testing.
// We first initialize serversDatabasesAdvancedThreatProtectionSetting_STATUSGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func ServersDatabasesAdvancedThreatProtectionSetting_STATUSGenerator() gopter.Gen {
	if serversDatabasesAdvancedThreatProtectionSetting_STATUSGenerator != nil {
		return serversDatabasesAdvancedThreatProtectionSetting_STATUSGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_STATUS(generators)
	serversDatabasesAdvancedThreatProtectionSetting_STATUSGenerator = gen.Struct(reflect.TypeOf(ServersDatabasesAdvancedThreatProtectionSetting_STATUS{}), generators)

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_STATUS(generators)
	AddRelatedPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_STATUS(generators)
	serversDatabasesAdvancedThreatProtectionSetting_STATUSGenerator = gen.Struct(reflect.TypeOf(ServersDatabasesAdvancedThreatProtectionSetting_STATUS{}), generators)

	return serversDatabasesAdvancedThreatProtectionSetting_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_STATUS(gens map[string]gopter.Gen) {
	gens["CreationTime"] = gen.PtrOf(gen.AlphaString())
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["State"] = gen.PtrOf(gen.OneConstOf(AdvancedThreatProtectionProperties_State_STATUS_Disabled, AdvancedThreatProtectionProperties_State_STATUS_Enabled, AdvancedThreatProtectionProperties_State_STATUS_New))
	gens["Type"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_STATUS(gens map[string]gopter.Gen) {
	gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator())
}

func Test_ServersDatabasesAdvancedThreatProtectionSetting_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersDatabasesAdvancedThreatProtectionSetting_Spec to ServersDatabasesAdvancedThreatProtectionSetting_Spec via AssignProperties_To_ServersDatabasesAdvancedThreatProtectionSetting_Spec & AssignProperties_From_ServersDatabasesAdvancedThreatProtectionSetting_Spec returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSetting_Spec, ServersDatabasesAdvancedThreatProtectionSetting_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSetting_Spec tests if a specific instance of ServersDatabasesAdvancedThreatProtectionSetting_Spec can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersDatabasesAdvancedThreatProtectionSetting_Spec(subject ServersDatabasesAdvancedThreatProtectionSetting_Spec) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.ServersDatabasesAdvancedThreatProtectionSetting_Spec
	err := copied.AssignProperties_To_ServersDatabasesAdvancedThreatProtectionSetting_Spec(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersDatabasesAdvancedThreatProtectionSetting_Spec
	err = actual.AssignProperties_From_ServersDatabasesAdvancedThreatProtectionSetting_Spec(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

func Test_ServersDatabasesAdvancedThreatProtectionSetting_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 80
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of ServersDatabasesAdvancedThreatProtectionSetting_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSetting_Spec, ServersDatabasesAdvancedThreatProtectionSetting_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

// RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSetting_Spec runs a test to see if a specific instance of ServersDatabasesAdvancedThreatProtectionSetting_Spec round trips to JSON and back losslessly
func RunJSONSerializationTestForServersDatabasesAdvancedThreatProtectionSetting_Spec(subject ServersDatabasesAdvancedThreatProtectionSetting_Spec) string {
	// Serialize to JSON
	bin, err := json.Marshal(subject)
	if err != nil {
		return err.Error()
	}

	// Deserialize back into memory
	var actual ServersDatabasesAdvancedThreatProtectionSetting_Spec
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of ServersDatabasesAdvancedThreatProtectionSetting_Spec instances for property testing - lazily
// instantiated by ServersDatabasesAdvancedThreatProtectionSetting_SpecGenerator()
var serversDatabasesAdvancedThreatProtectionSetting_SpecGenerator gopter.Gen

// ServersDatabasesAdvancedThreatProtectionSetting_SpecGenerator returns a generator of ServersDatabasesAdvancedThreatProtectionSetting_Spec instances for property testing.
// We first initialize serversDatabasesAdvancedThreatProtectionSetting_SpecGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func ServersDatabasesAdvancedThreatProtectionSetting_SpecGenerator() gopter.Gen {
	if serversDatabasesAdvancedThreatProtectionSetting_SpecGenerator != nil {
		return serversDatabasesAdvancedThreatProtectionSetting_SpecGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_Spec(generators)
	serversDatabasesAdvancedThreatProtectionSetting_SpecGenerator = gen.Struct(reflect.TypeOf(ServersDatabasesAdvancedThreatProtectionSetting_Spec{}), generators)

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_Spec(generators)
	AddRelatedPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_Spec(generators)
	serversDatabasesAdvancedThreatProtectionSetting_SpecGenerator = gen.Struct(reflect.TypeOf(ServersDatabasesAdvancedThreatProtectionSetting_Spec{}), generators)

	return serversDatabasesAdvancedThreatProtectionSetting_SpecGenerator
}

// AddIndependentPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_Spec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_Spec(gens map[string]gopter.Gen) {
	gens["State"] = gen.PtrOf(gen.OneConstOf(AdvancedThreatProtectionProperties_State_Disabled, AdvancedThreatProtectionProperties_State_Enabled, AdvancedThreatProtectionProperties_State_New))
}

// AddRelatedPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_Spec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForServersDatabasesAdvancedThreatProtectionSetting_Spec(gens map[string]gopter.Gen) {
	gens["OperatorSpec"] = gen.PtrOf(ServersDatabasesAdvancedThreatProtectionSettingOperatorSpecGenerator())
}
