// 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_ClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_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 ClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUS, ClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_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 ClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUS instances for
// property testing - lazily instantiated by
// ClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUSGenerator()
var clusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUSGenerator gopter.Gen

// ClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUSGenerator returns a generator of ClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUS instances for property testing.
func ClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUSGenerator() gopter.Gen {
	if clusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUSGenerator != nil {
		return clusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUSGenerator
	}

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

	return clusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_STATUS(gens map[string]gopter.Gen) {
	gens["IdentityType"] = gen.PtrOf(gen.OneConstOf(ClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_IdentityType_STATUS_SystemAssignedIdentity, ClusterProperties_Encryption_CustomerManagedKeyEncryption_KeyEncryptionKeyIdentity_IdentityType_STATUS_UserAssignedIdentity))
	gens["UserAssignedIdentityResourceId"] = gen.PtrOf(gen.AlphaString())
}

func Test_ClusterProperties_Encryption_CustomerManagedKeyEncryption_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 ClusterProperties_Encryption_CustomerManagedKeyEncryption_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForClusterProperties_Encryption_CustomerManagedKeyEncryption_STATUS, ClusterProperties_Encryption_CustomerManagedKeyEncryption_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ClusterProperties_Encryption_CustomerManagedKeyEncryption_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 ClusterProperties_Encryption_CustomerManagedKeyEncryption_STATUS instances for property testing - lazily
// instantiated by ClusterProperties_Encryption_CustomerManagedKeyEncryption_STATUSGenerator()
var clusterProperties_Encryption_CustomerManagedKeyEncryption_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForClusterProperties_Encryption_CustomerManagedKeyEncryption_STATUS(generators)
	AddRelatedPropertyGeneratorsForClusterProperties_Encryption_CustomerManagedKeyEncryption_STATUS(generators)
	clusterProperties_Encryption_CustomerManagedKeyEncryption_STATUSGenerator = gen.Struct(reflect.TypeOf(ClusterProperties_Encryption_CustomerManagedKeyEncryption_STATUS{}), generators)

	return clusterProperties_Encryption_CustomerManagedKeyEncryption_STATUSGenerator
}

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

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

func Test_ClusterProperties_Encryption_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 ClusterProperties_Encryption_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForClusterProperties_Encryption_STATUS, ClusterProperties_Encryption_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ClusterProperties_Encryption_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 ClusterProperties_Encryption_STATUS instances for property testing - lazily instantiated by
// ClusterProperties_Encryption_STATUSGenerator()
var clusterProperties_Encryption_STATUSGenerator gopter.Gen

// ClusterProperties_Encryption_STATUSGenerator returns a generator of ClusterProperties_Encryption_STATUS instances for property testing.
func ClusterProperties_Encryption_STATUSGenerator() gopter.Gen {
	if clusterProperties_Encryption_STATUSGenerator != nil {
		return clusterProperties_Encryption_STATUSGenerator
	}

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

	return clusterProperties_Encryption_STATUSGenerator
}

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

func Test_ClusterProperties_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 ClusterProperties_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForClusterProperties_STATUS, ClusterProperties_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ClusterProperties_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 ClusterProperties_STATUS instances for property testing - lazily instantiated by
// ClusterProperties_STATUSGenerator()
var clusterProperties_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForClusterProperties_STATUS(generators)
	AddRelatedPropertyGeneratorsForClusterProperties_STATUS(generators)
	clusterProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(ClusterProperties_STATUS{}), generators)

	return clusterProperties_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForClusterProperties_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForClusterProperties_STATUS(gens map[string]gopter.Gen) {
	gens["HighAvailability"] = gen.PtrOf(gen.OneConstOf(ClusterProperties_HighAvailability_STATUS_Disabled, ClusterProperties_HighAvailability_STATUS_Enabled))
	gens["HostName"] = gen.PtrOf(gen.AlphaString())
	gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(ClusterProperties_MinimumTlsVersion_STATUS_10, ClusterProperties_MinimumTlsVersion_STATUS_11, ClusterProperties_MinimumTlsVersion_STATUS_12))
	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["RedisVersion"] = gen.PtrOf(gen.AlphaString())
	gens["RedundancyMode"] = gen.PtrOf(gen.OneConstOf(ClusterProperties_RedundancyMode_STATUS_LR, ClusterProperties_RedundancyMode_STATUS_None, ClusterProperties_RedundancyMode_STATUS_ZR))
	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_Moving,
		ResourceState_STATUS_Running,
		ResourceState_STATUS_Scaling,
		ResourceState_STATUS_ScalingFailed,
		ResourceState_STATUS_UpdateFailed,
		ResourceState_STATUS_Updating))
}

// AddRelatedPropertyGeneratorsForClusterProperties_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForClusterProperties_STATUS(gens map[string]gopter.Gen) {
	gens["Encryption"] = gen.PtrOf(ClusterProperties_Encryption_STATUSGenerator())
	gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnection_STATUSGenerator())
}

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

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

	// Deserialize back into memory
	var actual ManagedServiceIdentity_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 ManagedServiceIdentity_STATUS instances for property testing - lazily instantiated by
// ManagedServiceIdentity_STATUSGenerator()
var managedServiceIdentity_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForManagedServiceIdentity_STATUS(generators)
	AddRelatedPropertyGeneratorsForManagedServiceIdentity_STATUS(generators)
	managedServiceIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(ManagedServiceIdentity_STATUS{}), generators)

	return managedServiceIdentity_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForManagedServiceIdentity_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForManagedServiceIdentity_STATUS(gens map[string]gopter.Gen) {
	gens["PrincipalId"] = gen.PtrOf(gen.AlphaString())
	gens["TenantId"] = gen.PtrOf(gen.AlphaString())
	gens["Type"] = gen.PtrOf(gen.OneConstOf(
		ManagedServiceIdentityType_STATUS_None,
		ManagedServiceIdentityType_STATUS_SystemAssigned,
		ManagedServiceIdentityType_STATUS_SystemAssignedUserAssigned,
		ManagedServiceIdentityType_STATUS_UserAssigned))
}

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

func Test_PrivateEndpointConnection_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 PrivateEndpointConnection_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual PrivateEndpointConnection_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 PrivateEndpointConnection_STATUS instances for property testing - lazily instantiated by
// PrivateEndpointConnection_STATUSGenerator()
var privateEndpointConnection_STATUSGenerator gopter.Gen

// PrivateEndpointConnection_STATUSGenerator returns a generator of PrivateEndpointConnection_STATUS instances for property testing.
func PrivateEndpointConnection_STATUSGenerator() gopter.Gen {
	if privateEndpointConnection_STATUSGenerator != nil {
		return privateEndpointConnection_STATUSGenerator
	}

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

	return privateEndpointConnection_STATUSGenerator
}

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

func Test_RedisEnterprise_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 RedisEnterprise_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForRedisEnterprise_STATUS, RedisEnterprise_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual RedisEnterprise_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 RedisEnterprise_STATUS instances for property testing - lazily instantiated by
// RedisEnterprise_STATUSGenerator()
var redisEnterprise_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForRedisEnterprise_STATUS(generators)
	AddRelatedPropertyGeneratorsForRedisEnterprise_STATUS(generators)
	redisEnterprise_STATUSGenerator = gen.Struct(reflect.TypeOf(RedisEnterprise_STATUS{}), generators)

	return redisEnterprise_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForRedisEnterprise_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForRedisEnterprise_STATUS(gens map[string]gopter.Gen) {
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["Kind"] = gen.PtrOf(gen.OneConstOf(Kind_STATUS_V1, Kind_STATUS_V2))
	gens["Location"] = gen.PtrOf(gen.AlphaString())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["Tags"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
	gens["Type"] = gen.PtrOf(gen.AlphaString())
	gens["Zones"] = gen.SliceOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForRedisEnterprise_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForRedisEnterprise_STATUS(gens map[string]gopter.Gen) {
	gens["Identity"] = gen.PtrOf(ManagedServiceIdentity_STATUSGenerator())
	gens["Properties"] = gen.PtrOf(ClusterProperties_STATUSGenerator())
	gens["Sku"] = gen.PtrOf(Sku_STATUSGenerator())
}

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

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

	// Deserialize back into memory
	var actual Sku_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 Sku_STATUS instances for property testing - lazily instantiated by Sku_STATUSGenerator()
var sku_STATUSGenerator gopter.Gen

// Sku_STATUSGenerator returns a generator of Sku_STATUS instances for property testing.
func Sku_STATUSGenerator() gopter.Gen {
	if sku_STATUSGenerator != nil {
		return sku_STATUSGenerator
	}

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

	return sku_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForSku_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSku_STATUS(gens map[string]gopter.Gen) {
	gens["Capacity"] = gen.PtrOf(gen.Int())
	gens["Name"] = gen.PtrOf(gen.OneConstOf(
		Sku_Name_STATUS_Balanced_B0,
		Sku_Name_STATUS_Balanced_B1,
		Sku_Name_STATUS_Balanced_B10,
		Sku_Name_STATUS_Balanced_B100,
		Sku_Name_STATUS_Balanced_B1000,
		Sku_Name_STATUS_Balanced_B150,
		Sku_Name_STATUS_Balanced_B20,
		Sku_Name_STATUS_Balanced_B250,
		Sku_Name_STATUS_Balanced_B3,
		Sku_Name_STATUS_Balanced_B350,
		Sku_Name_STATUS_Balanced_B5,
		Sku_Name_STATUS_Balanced_B50,
		Sku_Name_STATUS_Balanced_B500,
		Sku_Name_STATUS_Balanced_B700,
		Sku_Name_STATUS_ComputeOptimized_X10,
		Sku_Name_STATUS_ComputeOptimized_X100,
		Sku_Name_STATUS_ComputeOptimized_X150,
		Sku_Name_STATUS_ComputeOptimized_X20,
		Sku_Name_STATUS_ComputeOptimized_X250,
		Sku_Name_STATUS_ComputeOptimized_X3,
		Sku_Name_STATUS_ComputeOptimized_X350,
		Sku_Name_STATUS_ComputeOptimized_X5,
		Sku_Name_STATUS_ComputeOptimized_X50,
		Sku_Name_STATUS_ComputeOptimized_X500,
		Sku_Name_STATUS_ComputeOptimized_X700,
		Sku_Name_STATUS_EnterpriseFlash_F1500,
		Sku_Name_STATUS_EnterpriseFlash_F300,
		Sku_Name_STATUS_EnterpriseFlash_F700,
		Sku_Name_STATUS_Enterprise_E1,
		Sku_Name_STATUS_Enterprise_E10,
		Sku_Name_STATUS_Enterprise_E100,
		Sku_Name_STATUS_Enterprise_E20,
		Sku_Name_STATUS_Enterprise_E200,
		Sku_Name_STATUS_Enterprise_E400,
		Sku_Name_STATUS_Enterprise_E5,
		Sku_Name_STATUS_Enterprise_E50,
		Sku_Name_STATUS_FlashOptimized_A1000,
		Sku_Name_STATUS_FlashOptimized_A1500,
		Sku_Name_STATUS_FlashOptimized_A2000,
		Sku_Name_STATUS_FlashOptimized_A250,
		Sku_Name_STATUS_FlashOptimized_A4500,
		Sku_Name_STATUS_FlashOptimized_A500,
		Sku_Name_STATUS_FlashOptimized_A700,
		Sku_Name_STATUS_MemoryOptimized_M10,
		Sku_Name_STATUS_MemoryOptimized_M100,
		Sku_Name_STATUS_MemoryOptimized_M1000,
		Sku_Name_STATUS_MemoryOptimized_M150,
		Sku_Name_STATUS_MemoryOptimized_M1500,
		Sku_Name_STATUS_MemoryOptimized_M20,
		Sku_Name_STATUS_MemoryOptimized_M2000,
		Sku_Name_STATUS_MemoryOptimized_M250,
		Sku_Name_STATUS_MemoryOptimized_M350,
		Sku_Name_STATUS_MemoryOptimized_M50,
		Sku_Name_STATUS_MemoryOptimized_M500,
		Sku_Name_STATUS_MemoryOptimized_M700))
}

func Test_UserAssignedIdentity_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 UserAssignedIdentity_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForUserAssignedIdentity_STATUS, UserAssignedIdentity_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual UserAssignedIdentity_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 UserAssignedIdentity_STATUS instances for property testing - lazily instantiated by
// UserAssignedIdentity_STATUSGenerator()
var userAssignedIdentity_STATUSGenerator gopter.Gen

// UserAssignedIdentity_STATUSGenerator returns a generator of UserAssignedIdentity_STATUS instances for property testing.
func UserAssignedIdentity_STATUSGenerator() gopter.Gen {
	if userAssignedIdentity_STATUSGenerator != nil {
		return userAssignedIdentity_STATUSGenerator
	}

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

	return userAssignedIdentity_STATUSGenerator
}

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