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

import (
	"encoding/json"
	v20230701s "github.com/Azure/azure-service-operator/v2/api/cache/v1api20230701/storage"
	v20250401s "github.com/Azure/azure-service-operator/v2/api/cache/v1api20250401/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_DatabaseProperties_GeoReplication_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from DatabaseProperties_GeoReplication to DatabaseProperties_GeoReplication via AssignProperties_To_DatabaseProperties_GeoReplication & AssignProperties_From_DatabaseProperties_GeoReplication returns original",
		prop.ForAll(RunPropertyAssignmentTestForDatabaseProperties_GeoReplication, DatabaseProperties_GeoReplicationGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForDatabaseProperties_GeoReplication(generators)
	AddRelatedPropertyGeneratorsForDatabaseProperties_GeoReplication(generators)
	databaseProperties_GeoReplicationGenerator = gen.Struct(reflect.TypeOf(DatabaseProperties_GeoReplication{}), generators)

	return databaseProperties_GeoReplicationGenerator
}

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

// AddRelatedPropertyGeneratorsForDatabaseProperties_GeoReplication is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForDatabaseProperties_GeoReplication(gens map[string]gopter.Gen) {
	gens["LinkedDatabases"] = gen.SliceOf(LinkedDatabaseGenerator())
}

func Test_DatabaseProperties_GeoReplication_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from DatabaseProperties_GeoReplication_STATUS to DatabaseProperties_GeoReplication_STATUS via AssignProperties_To_DatabaseProperties_GeoReplication_STATUS & AssignProperties_From_DatabaseProperties_GeoReplication_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForDatabaseProperties_GeoReplication_STATUS, DatabaseProperties_GeoReplication_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

	// Deserialize back into memory
	var actual DatabaseProperties_GeoReplication_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 DatabaseProperties_GeoReplication_STATUS instances for property testing - lazily instantiated by
// DatabaseProperties_GeoReplication_STATUSGenerator()
var databaseProperties_GeoReplication_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForDatabaseProperties_GeoReplication_STATUS(generators)
	AddRelatedPropertyGeneratorsForDatabaseProperties_GeoReplication_STATUS(generators)
	databaseProperties_GeoReplication_STATUSGenerator = gen.Struct(reflect.TypeOf(DatabaseProperties_GeoReplication_STATUS{}), generators)

	return databaseProperties_GeoReplication_STATUSGenerator
}

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

// AddRelatedPropertyGeneratorsForDatabaseProperties_GeoReplication_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForDatabaseProperties_GeoReplication_STATUS(gens map[string]gopter.Gen) {
	gens["LinkedDatabases"] = gen.SliceOf(LinkedDatabase_STATUSGenerator())
}

func Test_LinkedDatabase_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from LinkedDatabase to LinkedDatabase via AssignProperties_To_LinkedDatabase & AssignProperties_From_LinkedDatabase returns original",
		prop.ForAll(RunPropertyAssignmentTestForLinkedDatabase, LinkedDatabaseGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

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

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

// LinkedDatabaseGenerator returns a generator of LinkedDatabase instances for property testing.
func LinkedDatabaseGenerator() gopter.Gen {
	if linkedDatabaseGenerator != nil {
		return linkedDatabaseGenerator
	}

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

	return linkedDatabaseGenerator
}

func Test_LinkedDatabase_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from LinkedDatabase_STATUS to LinkedDatabase_STATUS via AssignProperties_To_LinkedDatabase_STATUS & AssignProperties_From_LinkedDatabase_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForLinkedDatabase_STATUS, LinkedDatabase_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

	// Deserialize back into memory
	var actual LinkedDatabase_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 LinkedDatabase_STATUS instances for property testing - lazily instantiated by
// LinkedDatabase_STATUSGenerator()
var linkedDatabase_STATUSGenerator gopter.Gen

// LinkedDatabase_STATUSGenerator returns a generator of LinkedDatabase_STATUS instances for property testing.
func LinkedDatabase_STATUSGenerator() gopter.Gen {
	if linkedDatabase_STATUSGenerator != nil {
		return linkedDatabase_STATUSGenerator
	}

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

	return linkedDatabase_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForLinkedDatabase_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForLinkedDatabase_STATUS(gens map[string]gopter.Gen) {
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["State"] = gen.PtrOf(gen.OneConstOf(
		LinkedDatabase_State_STATUS_LinkFailed,
		LinkedDatabase_State_STATUS_Linked,
		LinkedDatabase_State_STATUS_Linking,
		LinkedDatabase_State_STATUS_UnlinkFailed,
		LinkedDatabase_State_STATUS_Unlinking))
}

func Test_Module_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from Module to Module via AssignProperties_To_Module & AssignProperties_From_Module returns original",
		prop.ForAll(RunPropertyAssignmentTestForModule, ModuleGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

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

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

// ModuleGenerator returns a generator of Module instances for property testing.
func ModuleGenerator() gopter.Gen {
	if moduleGenerator != nil {
		return moduleGenerator
	}

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

	return moduleGenerator
}

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

func Test_Module_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from Module_STATUS to Module_STATUS via AssignProperties_To_Module_STATUS & AssignProperties_From_Module_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForModule_STATUS, Module_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

	// Deserialize back into memory
	var actual Module_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 Module_STATUS instances for property testing - lazily instantiated by Module_STATUSGenerator()
var module_STATUSGenerator gopter.Gen

// Module_STATUSGenerator returns a generator of Module_STATUS instances for property testing.
func Module_STATUSGenerator() gopter.Gen {
	if module_STATUSGenerator != nil {
		return module_STATUSGenerator
	}

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

	return module_STATUSGenerator
}

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

func Test_Persistence_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from Persistence to Persistence via AssignProperties_To_Persistence & AssignProperties_From_Persistence returns original",
		prop.ForAll(RunPropertyAssignmentTestForPersistence, PersistenceGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

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

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

// PersistenceGenerator returns a generator of Persistence instances for property testing.
func PersistenceGenerator() gopter.Gen {
	if persistenceGenerator != nil {
		return persistenceGenerator
	}

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

	return persistenceGenerator
}

// AddIndependentPropertyGeneratorsForPersistence is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPersistence(gens map[string]gopter.Gen) {
	gens["AofEnabled"] = gen.PtrOf(gen.Bool())
	gens["AofFrequency"] = gen.PtrOf(gen.OneConstOf(Persistence_AofFrequency_1S, Persistence_AofFrequency_Always))
	gens["RdbEnabled"] = gen.PtrOf(gen.Bool())
	gens["RdbFrequency"] = gen.PtrOf(gen.OneConstOf(Persistence_RdbFrequency_12H, Persistence_RdbFrequency_1H, Persistence_RdbFrequency_6H))
}

func Test_Persistence_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from Persistence_STATUS to Persistence_STATUS via AssignProperties_To_Persistence_STATUS & AssignProperties_From_Persistence_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForPersistence_STATUS, Persistence_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

	// Deserialize back into memory
	var actual Persistence_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 Persistence_STATUS instances for property testing - lazily instantiated by Persistence_STATUSGenerator()
var persistence_STATUSGenerator gopter.Gen

// Persistence_STATUSGenerator returns a generator of Persistence_STATUS instances for property testing.
func Persistence_STATUSGenerator() gopter.Gen {
	if persistence_STATUSGenerator != nil {
		return persistence_STATUSGenerator
	}

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

	return persistence_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForPersistence_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPersistence_STATUS(gens map[string]gopter.Gen) {
	gens["AofEnabled"] = gen.PtrOf(gen.Bool())
	gens["AofFrequency"] = gen.PtrOf(gen.OneConstOf(Persistence_AofFrequency_STATUS_1S, Persistence_AofFrequency_STATUS_Always))
	gens["RdbEnabled"] = gen.PtrOf(gen.Bool())
	gens["RdbFrequency"] = gen.PtrOf(gen.OneConstOf(Persistence_RdbFrequency_STATUS_12H, Persistence_RdbFrequency_STATUS_1H, Persistence_RdbFrequency_STATUS_6H))
}

func Test_RedisEnterpriseDatabase_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 RedisEnterpriseDatabase to hub returns original",
		prop.ForAll(RunResourceConversionTestForRedisEnterpriseDatabase, RedisEnterpriseDatabaseGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

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

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

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

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

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

// RedisEnterpriseDatabaseGenerator returns a generator of RedisEnterpriseDatabase instances for property testing.
func RedisEnterpriseDatabaseGenerator() gopter.Gen {
	if redisEnterpriseDatabaseGenerator != nil {
		return redisEnterpriseDatabaseGenerator
	}

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

	return redisEnterpriseDatabaseGenerator
}

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

func Test_RedisEnterpriseDatabaseOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from RedisEnterpriseDatabaseOperatorSpec to RedisEnterpriseDatabaseOperatorSpec via AssignProperties_To_RedisEnterpriseDatabaseOperatorSpec & AssignProperties_From_RedisEnterpriseDatabaseOperatorSpec returns original",
		prop.ForAll(RunPropertyAssignmentTestForRedisEnterpriseDatabaseOperatorSpec, RedisEnterpriseDatabaseOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

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

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

// RedisEnterpriseDatabaseOperatorSpecGenerator returns a generator of RedisEnterpriseDatabaseOperatorSpec instances for property testing.
func RedisEnterpriseDatabaseOperatorSpecGenerator() gopter.Gen {
	if redisEnterpriseDatabaseOperatorSpecGenerator != nil {
		return redisEnterpriseDatabaseOperatorSpecGenerator
	}

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

	return redisEnterpriseDatabaseOperatorSpecGenerator
}

func Test_RedisEnterpriseDatabase_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from RedisEnterpriseDatabase_STATUS to RedisEnterpriseDatabase_STATUS via AssignProperties_To_RedisEnterpriseDatabase_STATUS & AssignProperties_From_RedisEnterpriseDatabase_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForRedisEnterpriseDatabase_STATUS, RedisEnterpriseDatabase_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

	// Deserialize back into memory
	var actual RedisEnterpriseDatabase_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 RedisEnterpriseDatabase_STATUS instances for property testing - lazily instantiated by
// RedisEnterpriseDatabase_STATUSGenerator()
var redisEnterpriseDatabase_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForRedisEnterpriseDatabase_STATUS(generators)
	AddRelatedPropertyGeneratorsForRedisEnterpriseDatabase_STATUS(generators)
	redisEnterpriseDatabase_STATUSGenerator = gen.Struct(reflect.TypeOf(RedisEnterpriseDatabase_STATUS{}), generators)

	return redisEnterpriseDatabase_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForRedisEnterpriseDatabase_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForRedisEnterpriseDatabase_STATUS(gens map[string]gopter.Gen) {
	gens["ClientProtocol"] = gen.PtrOf(gen.OneConstOf(DatabaseProperties_ClientProtocol_STATUS_Encrypted, DatabaseProperties_ClientProtocol_STATUS_Plaintext))
	gens["ClusteringPolicy"] = gen.PtrOf(gen.OneConstOf(DatabaseProperties_ClusteringPolicy_STATUS_EnterpriseCluster, DatabaseProperties_ClusteringPolicy_STATUS_OSSCluster))
	gens["EvictionPolicy"] = gen.PtrOf(gen.OneConstOf(
		DatabaseProperties_EvictionPolicy_STATUS_AllKeysLFU,
		DatabaseProperties_EvictionPolicy_STATUS_AllKeysLRU,
		DatabaseProperties_EvictionPolicy_STATUS_AllKeysRandom,
		DatabaseProperties_EvictionPolicy_STATUS_NoEviction,
		DatabaseProperties_EvictionPolicy_STATUS_VolatileLFU,
		DatabaseProperties_EvictionPolicy_STATUS_VolatileLRU,
		DatabaseProperties_EvictionPolicy_STATUS_VolatileRandom,
		DatabaseProperties_EvictionPolicy_STATUS_VolatileTTL))
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["Port"] = gen.PtrOf(gen.Int())
	gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf(
		ProvisioningState_STATUS_Canceled,
		ProvisioningState_STATUS_Creating,
		ProvisioningState_STATUS_Deleting,
		ProvisioningState_STATUS_Failed,
		ProvisioningState_STATUS_Succeeded,
		ProvisioningState_STATUS_Updating))
	gens["ResourceState"] = gen.PtrOf(gen.OneConstOf(
		ResourceState_STATUS_CreateFailed,
		ResourceState_STATUS_Creating,
		ResourceState_STATUS_DeleteFailed,
		ResourceState_STATUS_Deleting,
		ResourceState_STATUS_DisableFailed,
		ResourceState_STATUS_Disabled,
		ResourceState_STATUS_Disabling,
		ResourceState_STATUS_EnableFailed,
		ResourceState_STATUS_Enabling,
		ResourceState_STATUS_Running,
		ResourceState_STATUS_UpdateFailed,
		ResourceState_STATUS_Updating))
	gens["Type"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForRedisEnterpriseDatabase_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForRedisEnterpriseDatabase_STATUS(gens map[string]gopter.Gen) {
	gens["GeoReplication"] = gen.PtrOf(DatabaseProperties_GeoReplication_STATUSGenerator())
	gens["Modules"] = gen.SliceOf(Module_STATUSGenerator())
	gens["Persistence"] = gen.PtrOf(Persistence_STATUSGenerator())
}

func Test_RedisEnterpriseDatabase_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from RedisEnterpriseDatabase_Spec to RedisEnterpriseDatabase_Spec via AssignProperties_To_RedisEnterpriseDatabase_Spec & AssignProperties_From_RedisEnterpriseDatabase_Spec returns original",
		prop.ForAll(RunPropertyAssignmentTestForRedisEnterpriseDatabase_Spec, RedisEnterpriseDatabase_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

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

	// Deserialize back into memory
	var actual RedisEnterpriseDatabase_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 RedisEnterpriseDatabase_Spec instances for property testing - lazily instantiated by
// RedisEnterpriseDatabase_SpecGenerator()
var redisEnterpriseDatabase_SpecGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForRedisEnterpriseDatabase_Spec(generators)
	AddRelatedPropertyGeneratorsForRedisEnterpriseDatabase_Spec(generators)
	redisEnterpriseDatabase_SpecGenerator = gen.Struct(reflect.TypeOf(RedisEnterpriseDatabase_Spec{}), generators)

	return redisEnterpriseDatabase_SpecGenerator
}

// AddIndependentPropertyGeneratorsForRedisEnterpriseDatabase_Spec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForRedisEnterpriseDatabase_Spec(gens map[string]gopter.Gen) {
	gens["AzureName"] = gen.AlphaString()
	gens["ClientProtocol"] = gen.PtrOf(gen.OneConstOf(DatabaseProperties_ClientProtocol_Encrypted, DatabaseProperties_ClientProtocol_Plaintext))
	gens["ClusteringPolicy"] = gen.PtrOf(gen.OneConstOf(DatabaseProperties_ClusteringPolicy_EnterpriseCluster, DatabaseProperties_ClusteringPolicy_OSSCluster))
	gens["EvictionPolicy"] = gen.PtrOf(gen.OneConstOf(
		DatabaseProperties_EvictionPolicy_AllKeysLFU,
		DatabaseProperties_EvictionPolicy_AllKeysLRU,
		DatabaseProperties_EvictionPolicy_AllKeysRandom,
		DatabaseProperties_EvictionPolicy_NoEviction,
		DatabaseProperties_EvictionPolicy_VolatileLFU,
		DatabaseProperties_EvictionPolicy_VolatileLRU,
		DatabaseProperties_EvictionPolicy_VolatileRandom,
		DatabaseProperties_EvictionPolicy_VolatileTTL))
	gens["Port"] = gen.PtrOf(gen.Int())
}

// AddRelatedPropertyGeneratorsForRedisEnterpriseDatabase_Spec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForRedisEnterpriseDatabase_Spec(gens map[string]gopter.Gen) {
	gens["GeoReplication"] = gen.PtrOf(DatabaseProperties_GeoReplicationGenerator())
	gens["Modules"] = gen.SliceOf(ModuleGenerator())
	gens["OperatorSpec"] = gen.PtrOf(RedisEnterpriseDatabaseOperatorSpecGenerator())
	gens["Persistence"] = gen.PtrOf(PersistenceGenerator())
}
