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

import (
	"encoding/json"
	storage "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20250301/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_FleetMemberStatus_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from FleetMemberStatus_STATUS to FleetMemberStatus_STATUS via AssignProperties_To_FleetMemberStatus_STATUS & AssignProperties_From_FleetMemberStatus_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForFleetMemberStatus_STATUS, FleetMemberStatus_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForFleetMemberStatus_STATUS tests if a specific instance of FleetMemberStatus_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForFleetMemberStatus_STATUS(subject FleetMemberStatus_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.FleetMemberStatus_STATUS
	err := copied.AssignProperties_To_FleetMemberStatus_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual FleetMemberStatus_STATUS
	err = actual.AssignProperties_From_FleetMemberStatus_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_FleetMemberStatus_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 FleetMemberStatus_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForFleetMemberStatus_STATUS, FleetMemberStatus_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual FleetMemberStatus_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 FleetMemberStatus_STATUS instances for property testing - lazily instantiated by
// FleetMemberStatus_STATUSGenerator()
var fleetMemberStatus_STATUSGenerator gopter.Gen

// FleetMemberStatus_STATUSGenerator returns a generator of FleetMemberStatus_STATUS instances for property testing.
// We first initialize fleetMemberStatus_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 FleetMemberStatus_STATUSGenerator() gopter.Gen {
	if fleetMemberStatus_STATUSGenerator != nil {
		return fleetMemberStatus_STATUSGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForFleetMemberStatus_STATUS(generators)
	AddRelatedPropertyGeneratorsForFleetMemberStatus_STATUS(generators)
	fleetMemberStatus_STATUSGenerator = gen.Struct(reflect.TypeOf(FleetMemberStatus_STATUS{}), generators)

	return fleetMemberStatus_STATUSGenerator
}

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

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

func Test_FleetsMember_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 FleetsMember to hub returns original",
		prop.ForAll(RunResourceConversionTestForFleetsMember, FleetsMemberGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

	// Convert from our hub version
	var actual FleetsMember
	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_FleetsMember_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from FleetsMember to FleetsMember via AssignProperties_To_FleetsMember & AssignProperties_From_FleetsMember returns original",
		prop.ForAll(RunPropertyAssignmentTestForFleetsMember, FleetsMemberGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForFleetsMember tests if a specific instance of FleetsMember can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForFleetsMember(subject FleetsMember) 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.FleetsMember
	err := copied.AssignProperties_To_FleetsMember(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual FleetsMember
	err = actual.AssignProperties_From_FleetsMember(&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_FleetsMember_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 FleetsMember via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForFleetsMember, FleetsMemberGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual FleetsMember
	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 FleetsMember instances for property testing - lazily instantiated by FleetsMemberGenerator()
var fleetsMemberGenerator gopter.Gen

// FleetsMemberGenerator returns a generator of FleetsMember instances for property testing.
func FleetsMemberGenerator() gopter.Gen {
	if fleetsMemberGenerator != nil {
		return fleetsMemberGenerator
	}

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

	return fleetsMemberGenerator
}

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

func Test_FleetsMemberOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from FleetsMemberOperatorSpec to FleetsMemberOperatorSpec via AssignProperties_To_FleetsMemberOperatorSpec & AssignProperties_From_FleetsMemberOperatorSpec returns original",
		prop.ForAll(RunPropertyAssignmentTestForFleetsMemberOperatorSpec, FleetsMemberOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForFleetsMemberOperatorSpec tests if a specific instance of FleetsMemberOperatorSpec can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForFleetsMemberOperatorSpec(subject FleetsMemberOperatorSpec) 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.FleetsMemberOperatorSpec
	err := copied.AssignProperties_To_FleetsMemberOperatorSpec(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual FleetsMemberOperatorSpec
	err = actual.AssignProperties_From_FleetsMemberOperatorSpec(&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_FleetsMemberOperatorSpec_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 FleetsMemberOperatorSpec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForFleetsMemberOperatorSpec, FleetsMemberOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual FleetsMemberOperatorSpec
	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 FleetsMemberOperatorSpec instances for property testing - lazily instantiated by
// FleetsMemberOperatorSpecGenerator()
var fleetsMemberOperatorSpecGenerator gopter.Gen

// FleetsMemberOperatorSpecGenerator returns a generator of FleetsMemberOperatorSpec instances for property testing.
func FleetsMemberOperatorSpecGenerator() gopter.Gen {
	if fleetsMemberOperatorSpecGenerator != nil {
		return fleetsMemberOperatorSpecGenerator
	}

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

	return fleetsMemberOperatorSpecGenerator
}

func Test_FleetsMember_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from FleetsMember_STATUS to FleetsMember_STATUS via AssignProperties_To_FleetsMember_STATUS & AssignProperties_From_FleetsMember_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForFleetsMember_STATUS, FleetsMember_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForFleetsMember_STATUS tests if a specific instance of FleetsMember_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForFleetsMember_STATUS(subject FleetsMember_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.FleetsMember_STATUS
	err := copied.AssignProperties_To_FleetsMember_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual FleetsMember_STATUS
	err = actual.AssignProperties_From_FleetsMember_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_FleetsMember_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 FleetsMember_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForFleetsMember_STATUS, FleetsMember_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual FleetsMember_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 FleetsMember_STATUS instances for property testing - lazily instantiated by
// FleetsMember_STATUSGenerator()
var fleetsMember_STATUSGenerator gopter.Gen

// FleetsMember_STATUSGenerator returns a generator of FleetsMember_STATUS instances for property testing.
// We first initialize fleetsMember_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 FleetsMember_STATUSGenerator() gopter.Gen {
	if fleetsMember_STATUSGenerator != nil {
		return fleetsMember_STATUSGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForFleetsMember_STATUS(generators)
	AddRelatedPropertyGeneratorsForFleetsMember_STATUS(generators)
	fleetsMember_STATUSGenerator = gen.Struct(reflect.TypeOf(FleetsMember_STATUS{}), generators)

	return fleetsMember_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForFleetsMember_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForFleetsMember_STATUS(gens map[string]gopter.Gen) {
	gens["ClusterResourceId"] = gen.PtrOf(gen.AlphaString())
	gens["ETag"] = gen.PtrOf(gen.AlphaString())
	gens["Group"] = gen.PtrOf(gen.AlphaString())
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf(
		FleetMemberProvisioningState_STATUS_Canceled,
		FleetMemberProvisioningState_STATUS_Failed,
		FleetMemberProvisioningState_STATUS_Joining,
		FleetMemberProvisioningState_STATUS_Leaving,
		FleetMemberProvisioningState_STATUS_Succeeded,
		FleetMemberProvisioningState_STATUS_Updating))
	gens["Type"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_FleetsMember_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from FleetsMember_Spec to FleetsMember_Spec via AssignProperties_To_FleetsMember_Spec & AssignProperties_From_FleetsMember_Spec returns original",
		prop.ForAll(RunPropertyAssignmentTestForFleetsMember_Spec, FleetsMember_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForFleetsMember_Spec tests if a specific instance of FleetsMember_Spec can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForFleetsMember_Spec(subject FleetsMember_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.FleetsMember_Spec
	err := copied.AssignProperties_To_FleetsMember_Spec(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual FleetsMember_Spec
	err = actual.AssignProperties_From_FleetsMember_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_FleetsMember_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 FleetsMember_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForFleetsMember_Spec, FleetsMember_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual FleetsMember_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 FleetsMember_Spec instances for property testing - lazily instantiated by FleetsMember_SpecGenerator()
var fleetsMember_SpecGenerator gopter.Gen

// FleetsMember_SpecGenerator returns a generator of FleetsMember_Spec instances for property testing.
// We first initialize fleetsMember_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 FleetsMember_SpecGenerator() gopter.Gen {
	if fleetsMember_SpecGenerator != nil {
		return fleetsMember_SpecGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForFleetsMember_Spec(generators)
	AddRelatedPropertyGeneratorsForFleetsMember_Spec(generators)
	fleetsMember_SpecGenerator = gen.Struct(reflect.TypeOf(FleetsMember_Spec{}), generators)

	return fleetsMember_SpecGenerator
}

// AddIndependentPropertyGeneratorsForFleetsMember_Spec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForFleetsMember_Spec(gens map[string]gopter.Gen) {
	gens["AzureName"] = gen.AlphaString()
	gens["Group"] = gen.PtrOf(gen.AlphaString())
}

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