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

import (
	"encoding/json"
	"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_AppLogsConfiguration_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 AppLogsConfiguration via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAppLogsConfiguration, AppLogsConfigurationGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForAppLogsConfiguration(generators)
	AddRelatedPropertyGeneratorsForAppLogsConfiguration(generators)
	appLogsConfigurationGenerator = gen.Struct(reflect.TypeOf(AppLogsConfiguration{}), generators)

	return appLogsConfigurationGenerator
}

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

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

func Test_CertificateKeyVaultProperties_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 CertificateKeyVaultProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForCertificateKeyVaultProperties, CertificateKeyVaultPropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// CertificateKeyVaultPropertiesGenerator returns a generator of CertificateKeyVaultProperties instances for property testing.
func CertificateKeyVaultPropertiesGenerator() gopter.Gen {
	if certificateKeyVaultPropertiesGenerator != nil {
		return certificateKeyVaultPropertiesGenerator
	}

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

	return certificateKeyVaultPropertiesGenerator
}

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

func Test_CustomDomainConfiguration_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 CustomDomainConfiguration via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForCustomDomainConfiguration, CustomDomainConfigurationGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForCustomDomainConfiguration(generators)
	AddRelatedPropertyGeneratorsForCustomDomainConfiguration(generators)
	customDomainConfigurationGenerator = gen.Struct(reflect.TypeOf(CustomDomainConfiguration{}), generators)

	return customDomainConfigurationGenerator
}

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

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

func Test_LogAnalyticsConfiguration_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 LogAnalyticsConfiguration via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForLogAnalyticsConfiguration, LogAnalyticsConfigurationGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// LogAnalyticsConfigurationGenerator returns a generator of LogAnalyticsConfiguration instances for property testing.
func LogAnalyticsConfigurationGenerator() gopter.Gen {
	if logAnalyticsConfigurationGenerator != nil {
		return logAnalyticsConfigurationGenerator
	}

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

	return logAnalyticsConfigurationGenerator
}

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

func Test_ManagedEnvironment_Properties_PeerAuthentication_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 ManagedEnvironment_Properties_PeerAuthentication_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForManagedEnvironment_Properties_PeerAuthentication_Spec, ManagedEnvironment_Properties_PeerAuthentication_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ManagedEnvironment_Properties_PeerAuthentication_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 ManagedEnvironment_Properties_PeerAuthentication_Spec instances for property testing - lazily
// instantiated by ManagedEnvironment_Properties_PeerAuthentication_SpecGenerator()
var managedEnvironment_Properties_PeerAuthentication_SpecGenerator gopter.Gen

// ManagedEnvironment_Properties_PeerAuthentication_SpecGenerator returns a generator of ManagedEnvironment_Properties_PeerAuthentication_Spec instances for property testing.
func ManagedEnvironment_Properties_PeerAuthentication_SpecGenerator() gopter.Gen {
	if managedEnvironment_Properties_PeerAuthentication_SpecGenerator != nil {
		return managedEnvironment_Properties_PeerAuthentication_SpecGenerator
	}

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

	return managedEnvironment_Properties_PeerAuthentication_SpecGenerator
}

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

func Test_ManagedEnvironment_Properties_PeerTrafficConfiguration_Encryption_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 ManagedEnvironment_Properties_PeerTrafficConfiguration_Encryption_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForManagedEnvironment_Properties_PeerTrafficConfiguration_Encryption_Spec, ManagedEnvironment_Properties_PeerTrafficConfiguration_Encryption_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ManagedEnvironment_Properties_PeerTrafficConfiguration_Encryption_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 ManagedEnvironment_Properties_PeerTrafficConfiguration_Encryption_Spec instances for property testing -
// lazily instantiated by ManagedEnvironment_Properties_PeerTrafficConfiguration_Encryption_SpecGenerator()
var managedEnvironment_Properties_PeerTrafficConfiguration_Encryption_SpecGenerator gopter.Gen

// ManagedEnvironment_Properties_PeerTrafficConfiguration_Encryption_SpecGenerator returns a generator of ManagedEnvironment_Properties_PeerTrafficConfiguration_Encryption_Spec instances for property testing.
func ManagedEnvironment_Properties_PeerTrafficConfiguration_Encryption_SpecGenerator() gopter.Gen {
	if managedEnvironment_Properties_PeerTrafficConfiguration_Encryption_SpecGenerator != nil {
		return managedEnvironment_Properties_PeerTrafficConfiguration_Encryption_SpecGenerator
	}

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

	return managedEnvironment_Properties_PeerTrafficConfiguration_Encryption_SpecGenerator
}

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

func Test_ManagedEnvironment_Properties_PeerTrafficConfiguration_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 ManagedEnvironment_Properties_PeerTrafficConfiguration_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForManagedEnvironment_Properties_PeerTrafficConfiguration_Spec, ManagedEnvironment_Properties_PeerTrafficConfiguration_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ManagedEnvironment_Properties_PeerTrafficConfiguration_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 ManagedEnvironment_Properties_PeerTrafficConfiguration_Spec instances for property testing - lazily
// instantiated by ManagedEnvironment_Properties_PeerTrafficConfiguration_SpecGenerator()
var managedEnvironment_Properties_PeerTrafficConfiguration_SpecGenerator gopter.Gen

// ManagedEnvironment_Properties_PeerTrafficConfiguration_SpecGenerator returns a generator of ManagedEnvironment_Properties_PeerTrafficConfiguration_Spec instances for property testing.
func ManagedEnvironment_Properties_PeerTrafficConfiguration_SpecGenerator() gopter.Gen {
	if managedEnvironment_Properties_PeerTrafficConfiguration_SpecGenerator != nil {
		return managedEnvironment_Properties_PeerTrafficConfiguration_SpecGenerator
	}

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

	return managedEnvironment_Properties_PeerTrafficConfiguration_SpecGenerator
}

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

func Test_ManagedEnvironment_Properties_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 ManagedEnvironment_Properties_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForManagedEnvironment_Properties_Spec, ManagedEnvironment_Properties_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ManagedEnvironment_Properties_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 ManagedEnvironment_Properties_Spec instances for property testing - lazily instantiated by
// ManagedEnvironment_Properties_SpecGenerator()
var managedEnvironment_Properties_SpecGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForManagedEnvironment_Properties_Spec(generators)
	AddRelatedPropertyGeneratorsForManagedEnvironment_Properties_Spec(generators)
	managedEnvironment_Properties_SpecGenerator = gen.Struct(reflect.TypeOf(ManagedEnvironment_Properties_Spec{}), generators)

	return managedEnvironment_Properties_SpecGenerator
}

// AddIndependentPropertyGeneratorsForManagedEnvironment_Properties_Spec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForManagedEnvironment_Properties_Spec(gens map[string]gopter.Gen) {
	gens["DaprAIConnectionString"] = gen.PtrOf(gen.AlphaString())
	gens["DaprAIInstrumentationKey"] = gen.PtrOf(gen.AlphaString())
	gens["InfrastructureResourceGroup"] = gen.PtrOf(gen.AlphaString())
	gens["ZoneRedundant"] = gen.PtrOf(gen.Bool())
}

// AddRelatedPropertyGeneratorsForManagedEnvironment_Properties_Spec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForManagedEnvironment_Properties_Spec(gens map[string]gopter.Gen) {
	gens["AppLogsConfiguration"] = gen.PtrOf(AppLogsConfigurationGenerator())
	gens["CustomDomainConfiguration"] = gen.PtrOf(CustomDomainConfigurationGenerator())
	gens["PeerAuthentication"] = gen.PtrOf(ManagedEnvironment_Properties_PeerAuthentication_SpecGenerator())
	gens["PeerTrafficConfiguration"] = gen.PtrOf(ManagedEnvironment_Properties_PeerTrafficConfiguration_SpecGenerator())
	gens["VnetConfiguration"] = gen.PtrOf(VnetConfigurationGenerator())
	gens["WorkloadProfiles"] = gen.SliceOf(WorkloadProfileGenerator())
}

func Test_ManagedEnvironment_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 ManagedEnvironment_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForManagedEnvironment_Spec, ManagedEnvironment_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ManagedEnvironment_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 ManagedEnvironment_Spec instances for property testing - lazily instantiated by
// ManagedEnvironment_SpecGenerator()
var managedEnvironment_SpecGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForManagedEnvironment_Spec(generators)
	AddRelatedPropertyGeneratorsForManagedEnvironment_Spec(generators)
	managedEnvironment_SpecGenerator = gen.Struct(reflect.TypeOf(ManagedEnvironment_Spec{}), generators)

	return managedEnvironment_SpecGenerator
}

// AddIndependentPropertyGeneratorsForManagedEnvironment_Spec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForManagedEnvironment_Spec(gens map[string]gopter.Gen) {
	gens["Kind"] = gen.PtrOf(gen.AlphaString())
	gens["Location"] = gen.PtrOf(gen.AlphaString())
	gens["Name"] = gen.AlphaString()
	gens["Tags"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForManagedEnvironment_Spec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForManagedEnvironment_Spec(gens map[string]gopter.Gen) {
	gens["Identity"] = gen.PtrOf(ManagedServiceIdentityGenerator())
	gens["Properties"] = gen.PtrOf(ManagedEnvironment_Properties_SpecGenerator())
}

func Test_Mtls_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 Mtls via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMtls, MtlsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// MtlsGenerator returns a generator of Mtls instances for property testing.
func MtlsGenerator() gopter.Gen {
	if mtlsGenerator != nil {
		return mtlsGenerator
	}

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

	return mtlsGenerator
}

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

func Test_VnetConfiguration_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 VnetConfiguration via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForVnetConfiguration, VnetConfigurationGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// VnetConfigurationGenerator returns a generator of VnetConfiguration instances for property testing.
func VnetConfigurationGenerator() gopter.Gen {
	if vnetConfigurationGenerator != nil {
		return vnetConfigurationGenerator
	}

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

	return vnetConfigurationGenerator
}

// AddIndependentPropertyGeneratorsForVnetConfiguration is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForVnetConfiguration(gens map[string]gopter.Gen) {
	gens["DockerBridgeCidr"] = gen.PtrOf(gen.AlphaString())
	gens["InfrastructureSubnetId"] = gen.PtrOf(gen.AlphaString())
	gens["Internal"] = gen.PtrOf(gen.Bool())
	gens["PlatformReservedCidr"] = gen.PtrOf(gen.AlphaString())
	gens["PlatformReservedDnsIP"] = gen.PtrOf(gen.AlphaString())
}

func Test_WorkloadProfile_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 WorkloadProfile via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForWorkloadProfile, WorkloadProfileGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// WorkloadProfileGenerator returns a generator of WorkloadProfile instances for property testing.
func WorkloadProfileGenerator() gopter.Gen {
	if workloadProfileGenerator != nil {
		return workloadProfileGenerator
	}

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

	return workloadProfileGenerator
}

// AddIndependentPropertyGeneratorsForWorkloadProfile is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWorkloadProfile(gens map[string]gopter.Gen) {
	gens["MaximumCount"] = gen.PtrOf(gen.Int())
	gens["MinimumCount"] = gen.PtrOf(gen.Int())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["WorkloadProfileType"] = gen.PtrOf(gen.AlphaString())
}
