// 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_CosmosDbDataConnectionProperties_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 CosmosDbDataConnectionProperties_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForCosmosDbDataConnectionProperties_STATUS, CosmosDbDataConnectionProperties_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual CosmosDbDataConnectionProperties_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 CosmosDbDataConnectionProperties_STATUS instances for property testing - lazily instantiated by
// CosmosDbDataConnectionProperties_STATUSGenerator()
var cosmosDbDataConnectionProperties_STATUSGenerator gopter.Gen

// CosmosDbDataConnectionProperties_STATUSGenerator returns a generator of CosmosDbDataConnectionProperties_STATUS instances for property testing.
func CosmosDbDataConnectionProperties_STATUSGenerator() gopter.Gen {
	if cosmosDbDataConnectionProperties_STATUSGenerator != nil {
		return cosmosDbDataConnectionProperties_STATUSGenerator
	}

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

	return cosmosDbDataConnectionProperties_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForCosmosDbDataConnectionProperties_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForCosmosDbDataConnectionProperties_STATUS(gens map[string]gopter.Gen) {
	gens["CosmosDbAccountResourceId"] = gen.PtrOf(gen.AlphaString())
	gens["CosmosDbContainer"] = gen.PtrOf(gen.AlphaString())
	gens["CosmosDbDatabase"] = gen.PtrOf(gen.AlphaString())
	gens["ManagedIdentityObjectId"] = gen.PtrOf(gen.AlphaString())
	gens["ManagedIdentityResourceId"] = gen.PtrOf(gen.AlphaString())
	gens["MappingRuleName"] = gen.PtrOf(gen.AlphaString())
	gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf(
		ProvisioningState_STATUS_Canceled,
		ProvisioningState_STATUS_Creating,
		ProvisioningState_STATUS_Deleting,
		ProvisioningState_STATUS_Failed,
		ProvisioningState_STATUS_Moving,
		ProvisioningState_STATUS_Running,
		ProvisioningState_STATUS_Succeeded))
	gens["RetrievalStartDate"] = gen.PtrOf(gen.AlphaString())
	gens["TableName"] = gen.PtrOf(gen.AlphaString())
}

func Test_CosmosDbDataConnection_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 CosmosDbDataConnection_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForCosmosDbDataConnection_STATUS, CosmosDbDataConnection_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual CosmosDbDataConnection_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 CosmosDbDataConnection_STATUS instances for property testing - lazily instantiated by
// CosmosDbDataConnection_STATUSGenerator()
var cosmosDbDataConnection_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForCosmosDbDataConnection_STATUS(generators)
	AddRelatedPropertyGeneratorsForCosmosDbDataConnection_STATUS(generators)
	cosmosDbDataConnection_STATUSGenerator = gen.Struct(reflect.TypeOf(CosmosDbDataConnection_STATUS{}), generators)

	return cosmosDbDataConnection_STATUSGenerator
}

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

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

func Test_DataConnection_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 DataConnection_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDataConnection_STATUS, DataConnection_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual DataConnection_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 DataConnection_STATUS instances for property testing - lazily instantiated by
// DataConnection_STATUSGenerator()
var dataConnection_STATUSGenerator gopter.Gen

// DataConnection_STATUSGenerator returns a generator of DataConnection_STATUS instances for property testing.
func DataConnection_STATUSGenerator() gopter.Gen {
	if dataConnection_STATUSGenerator != nil {
		return dataConnection_STATUSGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddRelatedPropertyGeneratorsForDataConnection_STATUS(generators)

	// handle OneOf by choosing only one field to instantiate
	var gens []gopter.Gen
	for propName, propGen := range generators {
		props := map[string]gopter.Gen{propName: propGen}
		gens = append(gens, gen.Struct(reflect.TypeOf(DataConnection_STATUS{}), props))
	}
	dataConnection_STATUSGenerator = gen.OneGenOf(gens...)

	return dataConnection_STATUSGenerator
}

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

// AddRelatedPropertyGeneratorsForDataConnection_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForDataConnection_STATUS(gens map[string]gopter.Gen) {
	gens["CosmosDb"] = CosmosDbDataConnection_STATUSGenerator().Map(func(it CosmosDbDataConnection_STATUS) *CosmosDbDataConnection_STATUS {
		return &it
	}) // generate one case for OneOf type
	gens["EventGrid"] = EventGridDataConnection_STATUSGenerator().Map(func(it EventGridDataConnection_STATUS) *EventGridDataConnection_STATUS {
		return &it
	}) // generate one case for OneOf type
	gens["EventHub"] = EventHubDataConnection_STATUSGenerator().Map(func(it EventHubDataConnection_STATUS) *EventHubDataConnection_STATUS {
		return &it
	}) // generate one case for OneOf type
	gens["IotHub"] = IotHubDataConnection_STATUSGenerator().Map(func(it IotHubDataConnection_STATUS) *IotHubDataConnection_STATUS {
		return &it
	}) // generate one case for OneOf type
}

func Test_EventGridConnectionProperties_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 EventGridConnectionProperties_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForEventGridConnectionProperties_STATUS, EventGridConnectionProperties_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual EventGridConnectionProperties_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 EventGridConnectionProperties_STATUS instances for property testing - lazily instantiated by
// EventGridConnectionProperties_STATUSGenerator()
var eventGridConnectionProperties_STATUSGenerator gopter.Gen

// EventGridConnectionProperties_STATUSGenerator returns a generator of EventGridConnectionProperties_STATUS instances for property testing.
func EventGridConnectionProperties_STATUSGenerator() gopter.Gen {
	if eventGridConnectionProperties_STATUSGenerator != nil {
		return eventGridConnectionProperties_STATUSGenerator
	}

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

	return eventGridConnectionProperties_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForEventGridConnectionProperties_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForEventGridConnectionProperties_STATUS(gens map[string]gopter.Gen) {
	gens["BlobStorageEventType"] = gen.PtrOf(gen.OneConstOf(BlobStorageEventType_STATUS_MicrosoftStorageBlobCreated, BlobStorageEventType_STATUS_MicrosoftStorageBlobRenamed))
	gens["ConsumerGroup"] = gen.PtrOf(gen.AlphaString())
	gens["DataFormat"] = gen.PtrOf(gen.OneConstOf(
		EventGridDataFormat_STATUS_APACHEAVRO,
		EventGridDataFormat_STATUS_AVRO,
		EventGridDataFormat_STATUS_CSV,
		EventGridDataFormat_STATUS_JSON,
		EventGridDataFormat_STATUS_MULTIJSON,
		EventGridDataFormat_STATUS_ORC,
		EventGridDataFormat_STATUS_PARQUET,
		EventGridDataFormat_STATUS_PSV,
		EventGridDataFormat_STATUS_RAW,
		EventGridDataFormat_STATUS_SCSV,
		EventGridDataFormat_STATUS_SINGLEJSON,
		EventGridDataFormat_STATUS_SOHSV,
		EventGridDataFormat_STATUS_TSV,
		EventGridDataFormat_STATUS_TSVE,
		EventGridDataFormat_STATUS_TXT,
		EventGridDataFormat_STATUS_W3CLOGFILE))
	gens["DatabaseRouting"] = gen.PtrOf(gen.OneConstOf(EventGridConnectionProperties_DatabaseRouting_STATUS_Multi, EventGridConnectionProperties_DatabaseRouting_STATUS_Single))
	gens["EventGridResourceId"] = gen.PtrOf(gen.AlphaString())
	gens["EventHubResourceId"] = gen.PtrOf(gen.AlphaString())
	gens["IgnoreFirstRecord"] = gen.PtrOf(gen.Bool())
	gens["ManagedIdentityObjectId"] = gen.PtrOf(gen.AlphaString())
	gens["ManagedIdentityResourceId"] = gen.PtrOf(gen.AlphaString())
	gens["MappingRuleName"] = gen.PtrOf(gen.AlphaString())
	gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf(
		ProvisioningState_STATUS_Canceled,
		ProvisioningState_STATUS_Creating,
		ProvisioningState_STATUS_Deleting,
		ProvisioningState_STATUS_Failed,
		ProvisioningState_STATUS_Moving,
		ProvisioningState_STATUS_Running,
		ProvisioningState_STATUS_Succeeded))
	gens["StorageAccountResourceId"] = gen.PtrOf(gen.AlphaString())
	gens["TableName"] = gen.PtrOf(gen.AlphaString())
}

func Test_EventGridDataConnection_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 EventGridDataConnection_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForEventGridDataConnection_STATUS, EventGridDataConnection_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual EventGridDataConnection_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 EventGridDataConnection_STATUS instances for property testing - lazily instantiated by
// EventGridDataConnection_STATUSGenerator()
var eventGridDataConnection_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForEventGridDataConnection_STATUS(generators)
	AddRelatedPropertyGeneratorsForEventGridDataConnection_STATUS(generators)
	eventGridDataConnection_STATUSGenerator = gen.Struct(reflect.TypeOf(EventGridDataConnection_STATUS{}), generators)

	return eventGridDataConnection_STATUSGenerator
}

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

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

func Test_EventHubConnectionProperties_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 EventHubConnectionProperties_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForEventHubConnectionProperties_STATUS, EventHubConnectionProperties_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual EventHubConnectionProperties_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 EventHubConnectionProperties_STATUS instances for property testing - lazily instantiated by
// EventHubConnectionProperties_STATUSGenerator()
var eventHubConnectionProperties_STATUSGenerator gopter.Gen

// EventHubConnectionProperties_STATUSGenerator returns a generator of EventHubConnectionProperties_STATUS instances for property testing.
func EventHubConnectionProperties_STATUSGenerator() gopter.Gen {
	if eventHubConnectionProperties_STATUSGenerator != nil {
		return eventHubConnectionProperties_STATUSGenerator
	}

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

	return eventHubConnectionProperties_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForEventHubConnectionProperties_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForEventHubConnectionProperties_STATUS(gens map[string]gopter.Gen) {
	gens["Compression"] = gen.PtrOf(gen.OneConstOf(Compression_STATUS_GZip, Compression_STATUS_None))
	gens["ConsumerGroup"] = gen.PtrOf(gen.AlphaString())
	gens["DataFormat"] = gen.PtrOf(gen.OneConstOf(
		EventHubDataFormat_STATUS_APACHEAVRO,
		EventHubDataFormat_STATUS_AVRO,
		EventHubDataFormat_STATUS_CSV,
		EventHubDataFormat_STATUS_JSON,
		EventHubDataFormat_STATUS_MULTIJSON,
		EventHubDataFormat_STATUS_ORC,
		EventHubDataFormat_STATUS_PARQUET,
		EventHubDataFormat_STATUS_PSV,
		EventHubDataFormat_STATUS_RAW,
		EventHubDataFormat_STATUS_SCSV,
		EventHubDataFormat_STATUS_SINGLEJSON,
		EventHubDataFormat_STATUS_SOHSV,
		EventHubDataFormat_STATUS_TSV,
		EventHubDataFormat_STATUS_TSVE,
		EventHubDataFormat_STATUS_TXT,
		EventHubDataFormat_STATUS_W3CLOGFILE))
	gens["DatabaseRouting"] = gen.PtrOf(gen.OneConstOf(EventHubConnectionProperties_DatabaseRouting_STATUS_Multi, EventHubConnectionProperties_DatabaseRouting_STATUS_Single))
	gens["EventHubResourceId"] = gen.PtrOf(gen.AlphaString())
	gens["EventSystemProperties"] = gen.SliceOf(gen.AlphaString())
	gens["ManagedIdentityObjectId"] = gen.PtrOf(gen.AlphaString())
	gens["ManagedIdentityResourceId"] = gen.PtrOf(gen.AlphaString())
	gens["MappingRuleName"] = gen.PtrOf(gen.AlphaString())
	gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf(
		ProvisioningState_STATUS_Canceled,
		ProvisioningState_STATUS_Creating,
		ProvisioningState_STATUS_Deleting,
		ProvisioningState_STATUS_Failed,
		ProvisioningState_STATUS_Moving,
		ProvisioningState_STATUS_Running,
		ProvisioningState_STATUS_Succeeded))
	gens["RetrievalStartDate"] = gen.PtrOf(gen.AlphaString())
	gens["TableName"] = gen.PtrOf(gen.AlphaString())
}

func Test_EventHubDataConnection_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 EventHubDataConnection_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForEventHubDataConnection_STATUS, EventHubDataConnection_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual EventHubDataConnection_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 EventHubDataConnection_STATUS instances for property testing - lazily instantiated by
// EventHubDataConnection_STATUSGenerator()
var eventHubDataConnection_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForEventHubDataConnection_STATUS(generators)
	AddRelatedPropertyGeneratorsForEventHubDataConnection_STATUS(generators)
	eventHubDataConnection_STATUSGenerator = gen.Struct(reflect.TypeOf(EventHubDataConnection_STATUS{}), generators)

	return eventHubDataConnection_STATUSGenerator
}

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

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

func Test_IotHubConnectionProperties_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 IotHubConnectionProperties_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForIotHubConnectionProperties_STATUS, IotHubConnectionProperties_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual IotHubConnectionProperties_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 IotHubConnectionProperties_STATUS instances for property testing - lazily instantiated by
// IotHubConnectionProperties_STATUSGenerator()
var iotHubConnectionProperties_STATUSGenerator gopter.Gen

// IotHubConnectionProperties_STATUSGenerator returns a generator of IotHubConnectionProperties_STATUS instances for property testing.
func IotHubConnectionProperties_STATUSGenerator() gopter.Gen {
	if iotHubConnectionProperties_STATUSGenerator != nil {
		return iotHubConnectionProperties_STATUSGenerator
	}

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

	return iotHubConnectionProperties_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForIotHubConnectionProperties_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForIotHubConnectionProperties_STATUS(gens map[string]gopter.Gen) {
	gens["ConsumerGroup"] = gen.PtrOf(gen.AlphaString())
	gens["DataFormat"] = gen.PtrOf(gen.OneConstOf(
		IotHubDataFormat_STATUS_APACHEAVRO,
		IotHubDataFormat_STATUS_AVRO,
		IotHubDataFormat_STATUS_CSV,
		IotHubDataFormat_STATUS_JSON,
		IotHubDataFormat_STATUS_MULTIJSON,
		IotHubDataFormat_STATUS_ORC,
		IotHubDataFormat_STATUS_PARQUET,
		IotHubDataFormat_STATUS_PSV,
		IotHubDataFormat_STATUS_RAW,
		IotHubDataFormat_STATUS_SCSV,
		IotHubDataFormat_STATUS_SINGLEJSON,
		IotHubDataFormat_STATUS_SOHSV,
		IotHubDataFormat_STATUS_TSV,
		IotHubDataFormat_STATUS_TSVE,
		IotHubDataFormat_STATUS_TXT,
		IotHubDataFormat_STATUS_W3CLOGFILE))
	gens["DatabaseRouting"] = gen.PtrOf(gen.OneConstOf(IotHubConnectionProperties_DatabaseRouting_STATUS_Multi, IotHubConnectionProperties_DatabaseRouting_STATUS_Single))
	gens["EventSystemProperties"] = gen.SliceOf(gen.AlphaString())
	gens["IotHubResourceId"] = gen.PtrOf(gen.AlphaString())
	gens["MappingRuleName"] = gen.PtrOf(gen.AlphaString())
	gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf(
		ProvisioningState_STATUS_Canceled,
		ProvisioningState_STATUS_Creating,
		ProvisioningState_STATUS_Deleting,
		ProvisioningState_STATUS_Failed,
		ProvisioningState_STATUS_Moving,
		ProvisioningState_STATUS_Running,
		ProvisioningState_STATUS_Succeeded))
	gens["RetrievalStartDate"] = gen.PtrOf(gen.AlphaString())
	gens["SharedAccessPolicyName"] = gen.PtrOf(gen.AlphaString())
	gens["TableName"] = gen.PtrOf(gen.AlphaString())
}

func Test_IotHubDataConnection_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 IotHubDataConnection_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForIotHubDataConnection_STATUS, IotHubDataConnection_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual IotHubDataConnection_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 IotHubDataConnection_STATUS instances for property testing - lazily instantiated by
// IotHubDataConnection_STATUSGenerator()
var iotHubDataConnection_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForIotHubDataConnection_STATUS(generators)
	AddRelatedPropertyGeneratorsForIotHubDataConnection_STATUS(generators)
	iotHubDataConnection_STATUSGenerator = gen.Struct(reflect.TypeOf(IotHubDataConnection_STATUS{}), generators)

	return iotHubDataConnection_STATUSGenerator
}

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

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