// 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_PrivateEndpointConnectionProperties_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 PrivateEndpointConnectionProperties_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnectionProperties_STATUS, PrivateEndpointConnectionProperties_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual PrivateEndpointConnectionProperties_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 PrivateEndpointConnectionProperties_STATUS instances for property testing - lazily instantiated by
// PrivateEndpointConnectionProperties_STATUSGenerator()
var privateEndpointConnectionProperties_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrivateEndpointConnectionProperties_STATUS(generators)
	AddRelatedPropertyGeneratorsForPrivateEndpointConnectionProperties_STATUS(generators)
	privateEndpointConnectionProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnectionProperties_STATUS{}), generators)

	return privateEndpointConnectionProperties_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForPrivateEndpointConnectionProperties_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrivateEndpointConnectionProperties_STATUS(gens map[string]gopter.Gen) {
	gens["GroupIds"] = gen.SliceOf(gen.AlphaString())
	gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf(
		PrivateEndpointConnectionProperties_ProvisioningState_STATUS_Approving,
		PrivateEndpointConnectionProperties_ProvisioningState_STATUS_Dropping,
		PrivateEndpointConnectionProperties_ProvisioningState_STATUS_Failed,
		PrivateEndpointConnectionProperties_ProvisioningState_STATUS_Ready,
		PrivateEndpointConnectionProperties_ProvisioningState_STATUS_Rejecting))
}

// AddRelatedPropertyGeneratorsForPrivateEndpointConnectionProperties_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForPrivateEndpointConnectionProperties_STATUS(gens map[string]gopter.Gen) {
	gens["PrivateEndpoint"] = gen.PtrOf(PrivateEndpointProperty_STATUSGenerator())
	gens["PrivateLinkServiceConnectionState"] = gen.PtrOf(PrivateLinkServiceConnectionStateProperty_STATUSGenerator())
}

func Test_PrivateEndpointProperty_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 PrivateEndpointProperty_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrivateEndpointProperty_STATUS, PrivateEndpointProperty_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual PrivateEndpointProperty_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 PrivateEndpointProperty_STATUS instances for property testing - lazily instantiated by
// PrivateEndpointProperty_STATUSGenerator()
var privateEndpointProperty_STATUSGenerator gopter.Gen

// PrivateEndpointProperty_STATUSGenerator returns a generator of PrivateEndpointProperty_STATUS instances for property testing.
func PrivateEndpointProperty_STATUSGenerator() gopter.Gen {
	if privateEndpointProperty_STATUSGenerator != nil {
		return privateEndpointProperty_STATUSGenerator
	}

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

	return privateEndpointProperty_STATUSGenerator
}

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

func Test_PrivateLinkServiceConnectionStateProperty_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 PrivateLinkServiceConnectionStateProperty_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrivateLinkServiceConnectionStateProperty_STATUS, PrivateLinkServiceConnectionStateProperty_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual PrivateLinkServiceConnectionStateProperty_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 PrivateLinkServiceConnectionStateProperty_STATUS instances for property testing - lazily instantiated by
// PrivateLinkServiceConnectionStateProperty_STATUSGenerator()
var privateLinkServiceConnectionStateProperty_STATUSGenerator gopter.Gen

// PrivateLinkServiceConnectionStateProperty_STATUSGenerator returns a generator of PrivateLinkServiceConnectionStateProperty_STATUS instances for property testing.
func PrivateLinkServiceConnectionStateProperty_STATUSGenerator() gopter.Gen {
	if privateLinkServiceConnectionStateProperty_STATUSGenerator != nil {
		return privateLinkServiceConnectionStateProperty_STATUSGenerator
	}

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

	return privateLinkServiceConnectionStateProperty_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForPrivateLinkServiceConnectionStateProperty_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrivateLinkServiceConnectionStateProperty_STATUS(gens map[string]gopter.Gen) {
	gens["ActionsRequired"] = gen.PtrOf(gen.OneConstOf(PrivateLinkServiceConnectionStateProperty_ActionsRequired_STATUS_None))
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["Status"] = gen.PtrOf(gen.OneConstOf(
		PrivateLinkServiceConnectionStateProperty_Status_STATUS_Approved,
		PrivateLinkServiceConnectionStateProperty_Status_STATUS_Disconnected,
		PrivateLinkServiceConnectionStateProperty_Status_STATUS_Pending,
		PrivateLinkServiceConnectionStateProperty_Status_STATUS_Rejected))
}

func Test_ResourceIdentity_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 ResourceIdentity_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForResourceIdentity_STATUS, ResourceIdentity_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ResourceIdentity_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 ResourceIdentity_STATUS instances for property testing - lazily instantiated by
// ResourceIdentity_STATUSGenerator()
var resourceIdentity_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForResourceIdentity_STATUS(generators)
	AddRelatedPropertyGeneratorsForResourceIdentity_STATUS(generators)
	resourceIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(ResourceIdentity_STATUS{}), generators)

	return resourceIdentity_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForResourceIdentity_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForResourceIdentity_STATUS(gens map[string]gopter.Gen) {
	gens["PrincipalId"] = gen.PtrOf(gen.AlphaString())
	gens["TenantId"] = gen.PtrOf(gen.AlphaString())
	gens["Type"] = gen.PtrOf(gen.OneConstOf(
		ResourceIdentity_Type_STATUS_None,
		ResourceIdentity_Type_STATUS_SystemAssigned,
		ResourceIdentity_Type_STATUS_SystemAssignedUserAssigned,
		ResourceIdentity_Type_STATUS_UserAssigned))
}

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

func Test_ServerExternalAdministrator_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 ServerExternalAdministrator_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServerExternalAdministrator_STATUS, ServerExternalAdministrator_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ServerExternalAdministrator_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 ServerExternalAdministrator_STATUS instances for property testing - lazily instantiated by
// ServerExternalAdministrator_STATUSGenerator()
var serverExternalAdministrator_STATUSGenerator gopter.Gen

// ServerExternalAdministrator_STATUSGenerator returns a generator of ServerExternalAdministrator_STATUS instances for property testing.
func ServerExternalAdministrator_STATUSGenerator() gopter.Gen {
	if serverExternalAdministrator_STATUSGenerator != nil {
		return serverExternalAdministrator_STATUSGenerator
	}

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

	return serverExternalAdministrator_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForServerExternalAdministrator_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForServerExternalAdministrator_STATUS(gens map[string]gopter.Gen) {
	gens["AdministratorType"] = gen.PtrOf(gen.OneConstOf(ServerExternalAdministrator_AdministratorType_STATUS_ActiveDirectory))
	gens["AzureADOnlyAuthentication"] = gen.PtrOf(gen.Bool())
	gens["Login"] = gen.PtrOf(gen.AlphaString())
	gens["PrincipalType"] = gen.PtrOf(gen.OneConstOf(ServerExternalAdministrator_PrincipalType_STATUS_Application, ServerExternalAdministrator_PrincipalType_STATUS_Group, ServerExternalAdministrator_PrincipalType_STATUS_User))
	gens["Sid"] = gen.PtrOf(gen.AlphaString())
	gens["TenantId"] = gen.PtrOf(gen.AlphaString())
}

func Test_ServerPrivateEndpointConnection_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 ServerPrivateEndpointConnection_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServerPrivateEndpointConnection_STATUS, ServerPrivateEndpointConnection_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ServerPrivateEndpointConnection_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 ServerPrivateEndpointConnection_STATUS instances for property testing - lazily instantiated by
// ServerPrivateEndpointConnection_STATUSGenerator()
var serverPrivateEndpointConnection_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForServerPrivateEndpointConnection_STATUS(generators)
	AddRelatedPropertyGeneratorsForServerPrivateEndpointConnection_STATUS(generators)
	serverPrivateEndpointConnection_STATUSGenerator = gen.Struct(reflect.TypeOf(ServerPrivateEndpointConnection_STATUS{}), generators)

	return serverPrivateEndpointConnection_STATUSGenerator
}

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

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

func Test_ServerProperties_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 ServerProperties_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServerProperties_STATUS, ServerProperties_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ServerProperties_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 ServerProperties_STATUS instances for property testing - lazily instantiated by
// ServerProperties_STATUSGenerator()
var serverProperties_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForServerProperties_STATUS(generators)
	AddRelatedPropertyGeneratorsForServerProperties_STATUS(generators)
	serverProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(ServerProperties_STATUS{}), generators)

	return serverProperties_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForServerProperties_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForServerProperties_STATUS(gens map[string]gopter.Gen) {
	gens["AdministratorLogin"] = gen.PtrOf(gen.AlphaString())
	gens["FederatedClientId"] = gen.PtrOf(gen.AlphaString())
	gens["FullyQualifiedDomainName"] = gen.PtrOf(gen.AlphaString())
	gens["KeyId"] = gen.PtrOf(gen.AlphaString())
	gens["MinimalTlsVersion"] = gen.PtrOf(gen.AlphaString())
	gens["PrimaryUserAssignedIdentityId"] = gen.PtrOf(gen.AlphaString())
	gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(ServerProperties_PublicNetworkAccess_STATUS_Disabled, ServerProperties_PublicNetworkAccess_STATUS_Enabled))
	gens["RestrictOutboundNetworkAccess"] = gen.PtrOf(gen.OneConstOf(ServerProperties_RestrictOutboundNetworkAccess_STATUS_Disabled, ServerProperties_RestrictOutboundNetworkAccess_STATUS_Enabled))
	gens["State"] = gen.PtrOf(gen.AlphaString())
	gens["Version"] = gen.PtrOf(gen.AlphaString())
	gens["WorkspaceFeature"] = gen.PtrOf(gen.OneConstOf(ServerProperties_WorkspaceFeature_STATUS_Connected, ServerProperties_WorkspaceFeature_STATUS_Disconnected))
}

// AddRelatedPropertyGeneratorsForServerProperties_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForServerProperties_STATUS(gens map[string]gopter.Gen) {
	gens["Administrators"] = gen.PtrOf(ServerExternalAdministrator_STATUSGenerator())
	gens["PrivateEndpointConnections"] = gen.SliceOf(ServerPrivateEndpointConnection_STATUSGenerator())
}

func Test_Server_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 Server_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServer_STATUS, Server_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual Server_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 Server_STATUS instances for property testing - lazily instantiated by Server_STATUSGenerator()
var server_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForServer_STATUS(generators)
	AddRelatedPropertyGeneratorsForServer_STATUS(generators)
	server_STATUSGenerator = gen.Struct(reflect.TypeOf(Server_STATUS{}), generators)

	return server_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForServer_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForServer_STATUS(gens map[string]gopter.Gen) {
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["Kind"] = gen.PtrOf(gen.AlphaString())
	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())
}

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

func Test_UserIdentity_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 UserIdentity_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForUserIdentity_STATUS, UserIdentity_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual UserIdentity_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 UserIdentity_STATUS instances for property testing - lazily instantiated by
// UserIdentity_STATUSGenerator()
var userIdentity_STATUSGenerator gopter.Gen

// UserIdentity_STATUSGenerator returns a generator of UserIdentity_STATUS instances for property testing.
func UserIdentity_STATUSGenerator() gopter.Gen {
	if userIdentity_STATUSGenerator != nil {
		return userIdentity_STATUSGenerator
	}

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

	return userIdentity_STATUSGenerator
}

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