// 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_AcrDetails_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 AcrDetails via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAcrDetails, AcrDetailsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// AcrDetailsGenerator returns a generator of AcrDetails instances for property testing.
func AcrDetailsGenerator() gopter.Gen {
	if acrDetailsGenerator != nil {
		return acrDetailsGenerator
	}

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

	return acrDetailsGenerator
}

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

func Test_ArmResourceId_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 ArmResourceId via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForArmResourceId, ArmResourceIdGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ArmResourceIdGenerator returns a generator of ArmResourceId instances for property testing.
func ArmResourceIdGenerator() gopter.Gen {
	if armResourceIdGenerator != nil {
		return armResourceIdGenerator
	}

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

	return armResourceIdGenerator
}

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

func Test_ManagedServiceIdentity_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 ManagedServiceIdentity via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForManagedServiceIdentity, ManagedServiceIdentityGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForManagedServiceIdentity(generators)
	AddRelatedPropertyGeneratorsForManagedServiceIdentity(generators)
	managedServiceIdentityGenerator = gen.Struct(reflect.TypeOf(ManagedServiceIdentity{}), generators)

	return managedServiceIdentityGenerator
}

// AddIndependentPropertyGeneratorsForManagedServiceIdentity is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForManagedServiceIdentity(gens map[string]gopter.Gen) {
	gens["Type"] = gen.PtrOf(gen.OneConstOf(
		ManagedServiceIdentityType_None,
		ManagedServiceIdentityType_SystemAssigned,
		ManagedServiceIdentityType_SystemAssignedUserAssigned,
		ManagedServiceIdentityType_UserAssigned))
}

// AddRelatedPropertyGeneratorsForManagedServiceIdentity is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForManagedServiceIdentity(gens map[string]gopter.Gen) {
	gens["UserAssignedIdentities"] = gen.MapOf(
		gen.AlphaString(),
		UserAssignedIdentityDetailsGenerator())
}

func Test_PrivateEndpointResource_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 PrivateEndpointResource via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrivateEndpointResource, PrivateEndpointResourceGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// PrivateEndpointResourceGenerator returns a generator of PrivateEndpointResource instances for property testing.
func PrivateEndpointResourceGenerator() gopter.Gen {
	if privateEndpointResourceGenerator != nil {
		return privateEndpointResourceGenerator
	}

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

	return privateEndpointResourceGenerator
}

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

func Test_RegistryPrivateEndpointConnection_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 RegistryPrivateEndpointConnection via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForRegistryPrivateEndpointConnection, RegistryPrivateEndpointConnectionGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForRegistryPrivateEndpointConnection(generators)
	AddRelatedPropertyGeneratorsForRegistryPrivateEndpointConnection(generators)
	registryPrivateEndpointConnectionGenerator = gen.Struct(reflect.TypeOf(RegistryPrivateEndpointConnection{}), generators)

	return registryPrivateEndpointConnectionGenerator
}

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

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

func Test_RegistryPrivateEndpointConnectionProperties_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 RegistryPrivateEndpointConnectionProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForRegistryPrivateEndpointConnectionProperties, RegistryPrivateEndpointConnectionPropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForRegistryPrivateEndpointConnectionProperties(generators)
	AddRelatedPropertyGeneratorsForRegistryPrivateEndpointConnectionProperties(generators)
	registryPrivateEndpointConnectionPropertiesGenerator = gen.Struct(reflect.TypeOf(RegistryPrivateEndpointConnectionProperties{}), generators)

	return registryPrivateEndpointConnectionPropertiesGenerator
}

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

// AddRelatedPropertyGeneratorsForRegistryPrivateEndpointConnectionProperties is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForRegistryPrivateEndpointConnectionProperties(gens map[string]gopter.Gen) {
	gens["PrivateEndpoint"] = gen.PtrOf(PrivateEndpointResourceGenerator())
	gens["RegistryPrivateLinkServiceConnectionState"] = gen.PtrOf(RegistryPrivateLinkServiceConnectionStateGenerator())
}

func Test_RegistryPrivateLinkServiceConnectionState_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 RegistryPrivateLinkServiceConnectionState via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForRegistryPrivateLinkServiceConnectionState, RegistryPrivateLinkServiceConnectionStateGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// RegistryPrivateLinkServiceConnectionStateGenerator returns a generator of RegistryPrivateLinkServiceConnectionState instances for property testing.
func RegistryPrivateLinkServiceConnectionStateGenerator() gopter.Gen {
	if registryPrivateLinkServiceConnectionStateGenerator != nil {
		return registryPrivateLinkServiceConnectionStateGenerator
	}

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

	return registryPrivateLinkServiceConnectionStateGenerator
}

// AddIndependentPropertyGeneratorsForRegistryPrivateLinkServiceConnectionState is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForRegistryPrivateLinkServiceConnectionState(gens map[string]gopter.Gen) {
	gens["ActionsRequired"] = gen.PtrOf(gen.AlphaString())
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["Status"] = gen.PtrOf(gen.OneConstOf(
		EndpointServiceConnectionStatus_Approved,
		EndpointServiceConnectionStatus_Disconnected,
		EndpointServiceConnectionStatus_Pending,
		EndpointServiceConnectionStatus_Rejected))
}

func Test_RegistryRegionArmDetails_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 RegistryRegionArmDetails via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForRegistryRegionArmDetails, RegistryRegionArmDetailsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForRegistryRegionArmDetails(generators)
	AddRelatedPropertyGeneratorsForRegistryRegionArmDetails(generators)
	registryRegionArmDetailsGenerator = gen.Struct(reflect.TypeOf(RegistryRegionArmDetails{}), generators)

	return registryRegionArmDetailsGenerator
}

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

// AddRelatedPropertyGeneratorsForRegistryRegionArmDetails is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForRegistryRegionArmDetails(gens map[string]gopter.Gen) {
	gens["AcrDetails"] = gen.SliceOf(AcrDetailsGenerator())
	gens["StorageAccountDetails"] = gen.SliceOf(StorageAccountDetailsGenerator())
}

func Test_RegistrySpec_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 RegistrySpec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForRegistrySpec, RegistrySpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForRegistrySpec(generators)
	AddRelatedPropertyGeneratorsForRegistrySpec(generators)
	registrySpecGenerator = gen.Struct(reflect.TypeOf(RegistrySpec{}), generators)

	return registrySpecGenerator
}

// AddIndependentPropertyGeneratorsForRegistrySpec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForRegistrySpec(gens map[string]gopter.Gen) {
	gens["DiscoveryUrl"] = gen.PtrOf(gen.AlphaString())
	gens["IntellectualPropertyPublisher"] = gen.PtrOf(gen.AlphaString())
	gens["MlFlowRegistryUri"] = gen.PtrOf(gen.AlphaString())
	gens["PublicNetworkAccess"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForRegistrySpec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForRegistrySpec(gens map[string]gopter.Gen) {
	gens["ManagedResourceGroup"] = gen.PtrOf(ArmResourceIdGenerator())
	gens["RegionDetails"] = gen.SliceOf(RegistryRegionArmDetailsGenerator())
	gens["RegistryPrivateEndpointConnections"] = gen.SliceOf(RegistryPrivateEndpointConnectionGenerator())
}

func Test_Registry_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 Registry_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForRegistry_Spec, Registry_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual Registry_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 Registry_Spec instances for property testing - lazily instantiated by Registry_SpecGenerator()
var registry_SpecGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForRegistry_Spec(generators)
	AddRelatedPropertyGeneratorsForRegistry_Spec(generators)
	registry_SpecGenerator = gen.Struct(reflect.TypeOf(Registry_Spec{}), generators)

	return registry_SpecGenerator
}

// AddIndependentPropertyGeneratorsForRegistry_Spec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForRegistry_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())
}

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

func Test_Sku_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 Sku via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSku, SkuGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// SkuGenerator returns a generator of Sku instances for property testing.
func SkuGenerator() gopter.Gen {
	if skuGenerator != nil {
		return skuGenerator
	}

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

	return skuGenerator
}

// AddIndependentPropertyGeneratorsForSku is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSku(gens map[string]gopter.Gen) {
	gens["Capacity"] = gen.PtrOf(gen.Int())
	gens["Family"] = gen.PtrOf(gen.AlphaString())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["Size"] = gen.PtrOf(gen.AlphaString())
	gens["Tier"] = gen.PtrOf(gen.OneConstOf(
		SkuTier_Basic,
		SkuTier_Free,
		SkuTier_Premium,
		SkuTier_Standard))
}

func Test_StorageAccountDetails_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 StorageAccountDetails via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForStorageAccountDetails, StorageAccountDetailsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// StorageAccountDetailsGenerator returns a generator of StorageAccountDetails instances for property testing.
func StorageAccountDetailsGenerator() gopter.Gen {
	if storageAccountDetailsGenerator != nil {
		return storageAccountDetailsGenerator
	}

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

	return storageAccountDetailsGenerator
}

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

func Test_SystemCreatedAcrAccount_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 SystemCreatedAcrAccount via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSystemCreatedAcrAccount, SystemCreatedAcrAccountGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// SystemCreatedAcrAccountGenerator returns a generator of SystemCreatedAcrAccount instances for property testing.
func SystemCreatedAcrAccountGenerator() gopter.Gen {
	if systemCreatedAcrAccountGenerator != nil {
		return systemCreatedAcrAccountGenerator
	}

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

	return systemCreatedAcrAccountGenerator
}

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

func Test_SystemCreatedStorageAccount_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 SystemCreatedStorageAccount via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSystemCreatedStorageAccount, SystemCreatedStorageAccountGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// SystemCreatedStorageAccountGenerator returns a generator of SystemCreatedStorageAccount instances for property testing.
func SystemCreatedStorageAccountGenerator() gopter.Gen {
	if systemCreatedStorageAccountGenerator != nil {
		return systemCreatedStorageAccountGenerator
	}

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

	return systemCreatedStorageAccountGenerator
}

// AddIndependentPropertyGeneratorsForSystemCreatedStorageAccount is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSystemCreatedStorageAccount(gens map[string]gopter.Gen) {
	gens["AllowBlobPublicAccess"] = gen.PtrOf(gen.Bool())
	gens["StorageAccountHnsEnabled"] = gen.PtrOf(gen.Bool())
	gens["StorageAccountName"] = gen.PtrOf(gen.AlphaString())
	gens["StorageAccountType"] = gen.PtrOf(gen.AlphaString())
}

func Test_UserAssignedIdentityDetails_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 UserAssignedIdentityDetails via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// UserAssignedIdentityDetailsGenerator returns a generator of UserAssignedIdentityDetails instances for property testing.
func UserAssignedIdentityDetailsGenerator() gopter.Gen {
	if userAssignedIdentityDetailsGenerator != nil {
		return userAssignedIdentityDetailsGenerator
	}

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

	return userAssignedIdentityDetailsGenerator
}
