// 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_PrivateDnsZoneConfig_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 PrivateDnsZoneConfig_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrivateDnsZoneConfig_STATUS, PrivateDnsZoneConfig_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual PrivateDnsZoneConfig_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 PrivateDnsZoneConfig_STATUS instances for property testing - lazily instantiated by
// PrivateDnsZoneConfig_STATUSGenerator()
var privateDnsZoneConfig_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrivateDnsZoneConfig_STATUS(generators)
	AddRelatedPropertyGeneratorsForPrivateDnsZoneConfig_STATUS(generators)
	privateDnsZoneConfig_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateDnsZoneConfig_STATUS{}), generators)

	return privateDnsZoneConfig_STATUSGenerator
}

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

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

func Test_PrivateDnsZoneGroupPropertiesFormat_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 PrivateDnsZoneGroupPropertiesFormat_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrivateDnsZoneGroupPropertiesFormat_STATUS, PrivateDnsZoneGroupPropertiesFormat_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual PrivateDnsZoneGroupPropertiesFormat_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 PrivateDnsZoneGroupPropertiesFormat_STATUS instances for property testing - lazily instantiated by
// PrivateDnsZoneGroupPropertiesFormat_STATUSGenerator()
var privateDnsZoneGroupPropertiesFormat_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrivateDnsZoneGroupPropertiesFormat_STATUS(generators)
	AddRelatedPropertyGeneratorsForPrivateDnsZoneGroupPropertiesFormat_STATUS(generators)
	privateDnsZoneGroupPropertiesFormat_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateDnsZoneGroupPropertiesFormat_STATUS{}), generators)

	return privateDnsZoneGroupPropertiesFormat_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForPrivateDnsZoneGroupPropertiesFormat_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForPrivateDnsZoneGroupPropertiesFormat_STATUS(gens map[string]gopter.Gen) {
	gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf(
		ProvisioningState_STATUS_Deleting,
		ProvisioningState_STATUS_Failed,
		ProvisioningState_STATUS_Succeeded,
		ProvisioningState_STATUS_Updating))
}

// AddRelatedPropertyGeneratorsForPrivateDnsZoneGroupPropertiesFormat_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForPrivateDnsZoneGroupPropertiesFormat_STATUS(gens map[string]gopter.Gen) {
	gens["PrivateDnsZoneConfigs"] = gen.SliceOf(PrivateDnsZoneConfig_STATUSGenerator())
}

func Test_PrivateDnsZonePropertiesFormat_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 PrivateDnsZonePropertiesFormat_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrivateDnsZonePropertiesFormat_STATUS, PrivateDnsZonePropertiesFormat_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual PrivateDnsZonePropertiesFormat_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 PrivateDnsZonePropertiesFormat_STATUS instances for property testing - lazily instantiated by
// PrivateDnsZonePropertiesFormat_STATUSGenerator()
var privateDnsZonePropertiesFormat_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrivateDnsZonePropertiesFormat_STATUS(generators)
	AddRelatedPropertyGeneratorsForPrivateDnsZonePropertiesFormat_STATUS(generators)
	privateDnsZonePropertiesFormat_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateDnsZonePropertiesFormat_STATUS{}), generators)

	return privateDnsZonePropertiesFormat_STATUSGenerator
}

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

// AddRelatedPropertyGeneratorsForPrivateDnsZonePropertiesFormat_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForPrivateDnsZonePropertiesFormat_STATUS(gens map[string]gopter.Gen) {
	gens["RecordSets"] = gen.SliceOf(RecordSet_STATUSGenerator())
}

func Test_PrivateEndpointsPrivateDnsZoneGroup_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 PrivateEndpointsPrivateDnsZoneGroup_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForPrivateEndpointsPrivateDnsZoneGroup_STATUS, PrivateEndpointsPrivateDnsZoneGroup_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual PrivateEndpointsPrivateDnsZoneGroup_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 PrivateEndpointsPrivateDnsZoneGroup_STATUS instances for property testing - lazily instantiated by
// PrivateEndpointsPrivateDnsZoneGroup_STATUSGenerator()
var privateEndpointsPrivateDnsZoneGroup_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForPrivateEndpointsPrivateDnsZoneGroup_STATUS(generators)
	AddRelatedPropertyGeneratorsForPrivateEndpointsPrivateDnsZoneGroup_STATUS(generators)
	privateEndpointsPrivateDnsZoneGroup_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointsPrivateDnsZoneGroup_STATUS{}), generators)

	return privateEndpointsPrivateDnsZoneGroup_STATUSGenerator
}

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

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

func Test_RecordSet_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 RecordSet_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForRecordSet_STATUS, RecordSet_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual RecordSet_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 RecordSet_STATUS instances for property testing - lazily instantiated by RecordSet_STATUSGenerator()
var recordSet_STATUSGenerator gopter.Gen

// RecordSet_STATUSGenerator returns a generator of RecordSet_STATUS instances for property testing.
func RecordSet_STATUSGenerator() gopter.Gen {
	if recordSet_STATUSGenerator != nil {
		return recordSet_STATUSGenerator
	}

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

	return recordSet_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForRecordSet_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForRecordSet_STATUS(gens map[string]gopter.Gen) {
	gens["Fqdn"] = gen.PtrOf(gen.AlphaString())
	gens["IpAddresses"] = gen.SliceOf(gen.AlphaString())
	gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf(
		ProvisioningState_STATUS_Deleting,
		ProvisioningState_STATUS_Failed,
		ProvisioningState_STATUS_Succeeded,
		ProvisioningState_STATUS_Updating))
	gens["RecordSetName"] = gen.PtrOf(gen.AlphaString())
	gens["RecordType"] = gen.PtrOf(gen.AlphaString())
	gens["Ttl"] = gen.PtrOf(gen.Int())
}
