// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package storage

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_DnsConfig_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 100
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of DnsConfig via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDnsConfig, DnsConfigGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// DnsConfigGenerator returns a generator of DnsConfig instances for property testing.
func DnsConfigGenerator() gopter.Gen {
	if dnsConfigGenerator != nil {
		return dnsConfigGenerator
	}

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

	return dnsConfigGenerator
}

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

func Test_DnsConfig_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 DnsConfig_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDnsConfig_STATUS, DnsConfig_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual DnsConfig_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 DnsConfig_STATUS instances for property testing - lazily instantiated by DnsConfig_STATUSGenerator()
var dnsConfig_STATUSGenerator gopter.Gen

// DnsConfig_STATUSGenerator returns a generator of DnsConfig_STATUS instances for property testing.
func DnsConfig_STATUSGenerator() gopter.Gen {
	if dnsConfig_STATUSGenerator != nil {
		return dnsConfig_STATUSGenerator
	}

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

	return dnsConfig_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForDnsConfig_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForDnsConfig_STATUS(gens map[string]gopter.Gen) {
	gens["Fqdn"] = gen.PtrOf(gen.AlphaString())
	gens["RelativeName"] = gen.PtrOf(gen.AlphaString())
	gens["Ttl"] = gen.PtrOf(gen.Int())
}

func Test_Endpoint_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 Endpoint_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForEndpoint_STATUS, Endpoint_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual Endpoint_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 Endpoint_STATUS instances for property testing - lazily instantiated by Endpoint_STATUSGenerator()
var endpoint_STATUSGenerator gopter.Gen

// Endpoint_STATUSGenerator returns a generator of Endpoint_STATUS instances for property testing.
func Endpoint_STATUSGenerator() gopter.Gen {
	if endpoint_STATUSGenerator != nil {
		return endpoint_STATUSGenerator
	}

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

	return endpoint_STATUSGenerator
}

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

func Test_MonitorConfig_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 100
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of MonitorConfig via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMonitorConfig, MonitorConfigGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForMonitorConfig(generators)
	AddRelatedPropertyGeneratorsForMonitorConfig(generators)
	monitorConfigGenerator = gen.Struct(reflect.TypeOf(MonitorConfig{}), generators)

	return monitorConfigGenerator
}

// AddIndependentPropertyGeneratorsForMonitorConfig is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMonitorConfig(gens map[string]gopter.Gen) {
	gens["IntervalInSeconds"] = gen.PtrOf(gen.Int())
	gens["Path"] = gen.PtrOf(gen.AlphaString())
	gens["Port"] = gen.PtrOf(gen.Int())
	gens["ProfileMonitorStatus"] = gen.PtrOf(gen.AlphaString())
	gens["Protocol"] = gen.PtrOf(gen.AlphaString())
	gens["TimeoutInSeconds"] = gen.PtrOf(gen.Int())
	gens["ToleratedNumberOfFailures"] = gen.PtrOf(gen.Int())
}

// AddRelatedPropertyGeneratorsForMonitorConfig is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForMonitorConfig(gens map[string]gopter.Gen) {
	gens["CustomHeaders"] = gen.SliceOf(MonitorConfig_CustomHeadersGenerator())
	gens["ExpectedStatusCodeRanges"] = gen.SliceOf(MonitorConfig_ExpectedStatusCodeRangesGenerator())
}

func Test_MonitorConfig_CustomHeaders_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 100
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of MonitorConfig_CustomHeaders via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMonitorConfig_CustomHeaders, MonitorConfig_CustomHeadersGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// MonitorConfig_CustomHeadersGenerator returns a generator of MonitorConfig_CustomHeaders instances for property testing.
func MonitorConfig_CustomHeadersGenerator() gopter.Gen {
	if monitorConfig_CustomHeadersGenerator != nil {
		return monitorConfig_CustomHeadersGenerator
	}

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

	return monitorConfig_CustomHeadersGenerator
}

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

func Test_MonitorConfig_CustomHeaders_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 MonitorConfig_CustomHeaders_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMonitorConfig_CustomHeaders_STATUS, MonitorConfig_CustomHeaders_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MonitorConfig_CustomHeaders_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 MonitorConfig_CustomHeaders_STATUS instances for property testing - lazily instantiated by
// MonitorConfig_CustomHeaders_STATUSGenerator()
var monitorConfig_CustomHeaders_STATUSGenerator gopter.Gen

// MonitorConfig_CustomHeaders_STATUSGenerator returns a generator of MonitorConfig_CustomHeaders_STATUS instances for property testing.
func MonitorConfig_CustomHeaders_STATUSGenerator() gopter.Gen {
	if monitorConfig_CustomHeaders_STATUSGenerator != nil {
		return monitorConfig_CustomHeaders_STATUSGenerator
	}

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

	return monitorConfig_CustomHeaders_STATUSGenerator
}

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

func Test_MonitorConfig_ExpectedStatusCodeRanges_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 100
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of MonitorConfig_ExpectedStatusCodeRanges via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMonitorConfig_ExpectedStatusCodeRanges, MonitorConfig_ExpectedStatusCodeRangesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// MonitorConfig_ExpectedStatusCodeRangesGenerator returns a generator of MonitorConfig_ExpectedStatusCodeRanges instances for property testing.
func MonitorConfig_ExpectedStatusCodeRangesGenerator() gopter.Gen {
	if monitorConfig_ExpectedStatusCodeRangesGenerator != nil {
		return monitorConfig_ExpectedStatusCodeRangesGenerator
	}

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

	return monitorConfig_ExpectedStatusCodeRangesGenerator
}

// AddIndependentPropertyGeneratorsForMonitorConfig_ExpectedStatusCodeRanges is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMonitorConfig_ExpectedStatusCodeRanges(gens map[string]gopter.Gen) {
	gens["Max"] = gen.PtrOf(gen.Int())
	gens["Min"] = gen.PtrOf(gen.Int())
}

func Test_MonitorConfig_ExpectedStatusCodeRanges_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 MonitorConfig_ExpectedStatusCodeRanges_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMonitorConfig_ExpectedStatusCodeRanges_STATUS, MonitorConfig_ExpectedStatusCodeRanges_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MonitorConfig_ExpectedStatusCodeRanges_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 MonitorConfig_ExpectedStatusCodeRanges_STATUS instances for property testing - lazily instantiated by
// MonitorConfig_ExpectedStatusCodeRanges_STATUSGenerator()
var monitorConfig_ExpectedStatusCodeRanges_STATUSGenerator gopter.Gen

// MonitorConfig_ExpectedStatusCodeRanges_STATUSGenerator returns a generator of MonitorConfig_ExpectedStatusCodeRanges_STATUS instances for property testing.
func MonitorConfig_ExpectedStatusCodeRanges_STATUSGenerator() gopter.Gen {
	if monitorConfig_ExpectedStatusCodeRanges_STATUSGenerator != nil {
		return monitorConfig_ExpectedStatusCodeRanges_STATUSGenerator
	}

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

	return monitorConfig_ExpectedStatusCodeRanges_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForMonitorConfig_ExpectedStatusCodeRanges_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMonitorConfig_ExpectedStatusCodeRanges_STATUS(gens map[string]gopter.Gen) {
	gens["Max"] = gen.PtrOf(gen.Int())
	gens["Min"] = gen.PtrOf(gen.Int())
}

func Test_MonitorConfig_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 MonitorConfig_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMonitorConfig_STATUS, MonitorConfig_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MonitorConfig_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 MonitorConfig_STATUS instances for property testing - lazily instantiated by
// MonitorConfig_STATUSGenerator()
var monitorConfig_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForMonitorConfig_STATUS(generators)
	AddRelatedPropertyGeneratorsForMonitorConfig_STATUS(generators)
	monitorConfig_STATUSGenerator = gen.Struct(reflect.TypeOf(MonitorConfig_STATUS{}), generators)

	return monitorConfig_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForMonitorConfig_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMonitorConfig_STATUS(gens map[string]gopter.Gen) {
	gens["IntervalInSeconds"] = gen.PtrOf(gen.Int())
	gens["Path"] = gen.PtrOf(gen.AlphaString())
	gens["Port"] = gen.PtrOf(gen.Int())
	gens["ProfileMonitorStatus"] = gen.PtrOf(gen.AlphaString())
	gens["Protocol"] = gen.PtrOf(gen.AlphaString())
	gens["TimeoutInSeconds"] = gen.PtrOf(gen.Int())
	gens["ToleratedNumberOfFailures"] = gen.PtrOf(gen.Int())
}

// AddRelatedPropertyGeneratorsForMonitorConfig_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForMonitorConfig_STATUS(gens map[string]gopter.Gen) {
	gens["CustomHeaders"] = gen.SliceOf(MonitorConfig_CustomHeaders_STATUSGenerator())
	gens["ExpectedStatusCodeRanges"] = gen.SliceOf(MonitorConfig_ExpectedStatusCodeRanges_STATUSGenerator())
}

func Test_TrafficManagerProfile_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 20
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of TrafficManagerProfile via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForTrafficManagerProfile, TrafficManagerProfileGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// TrafficManagerProfileGenerator returns a generator of TrafficManagerProfile instances for property testing.
func TrafficManagerProfileGenerator() gopter.Gen {
	if trafficManagerProfileGenerator != nil {
		return trafficManagerProfileGenerator
	}

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

	return trafficManagerProfileGenerator
}

// AddRelatedPropertyGeneratorsForTrafficManagerProfile is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForTrafficManagerProfile(gens map[string]gopter.Gen) {
	gens["Spec"] = TrafficManagerProfile_SpecGenerator()
	gens["Status"] = TrafficManagerProfile_STATUSGenerator()
}

func Test_TrafficManagerProfileOperatorConfigMaps_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 100
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of TrafficManagerProfileOperatorConfigMaps via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForTrafficManagerProfileOperatorConfigMaps, TrafficManagerProfileOperatorConfigMapsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// TrafficManagerProfileOperatorConfigMapsGenerator returns a generator of TrafficManagerProfileOperatorConfigMaps instances for property testing.
func TrafficManagerProfileOperatorConfigMapsGenerator() gopter.Gen {
	if trafficManagerProfileOperatorConfigMapsGenerator != nil {
		return trafficManagerProfileOperatorConfigMapsGenerator
	}

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

	return trafficManagerProfileOperatorConfigMapsGenerator
}

func Test_TrafficManagerProfileOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 100
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of TrafficManagerProfileOperatorSpec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForTrafficManagerProfileOperatorSpec, TrafficManagerProfileOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// TrafficManagerProfileOperatorSpecGenerator returns a generator of TrafficManagerProfileOperatorSpec instances for property testing.
func TrafficManagerProfileOperatorSpecGenerator() gopter.Gen {
	if trafficManagerProfileOperatorSpecGenerator != nil {
		return trafficManagerProfileOperatorSpecGenerator
	}

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

	return trafficManagerProfileOperatorSpecGenerator
}

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

func Test_TrafficManagerProfile_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 TrafficManagerProfile_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForTrafficManagerProfile_STATUS, TrafficManagerProfile_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual TrafficManagerProfile_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 TrafficManagerProfile_STATUS instances for property testing - lazily instantiated by
// TrafficManagerProfile_STATUSGenerator()
var trafficManagerProfile_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForTrafficManagerProfile_STATUS(generators)
	AddRelatedPropertyGeneratorsForTrafficManagerProfile_STATUS(generators)
	trafficManagerProfile_STATUSGenerator = gen.Struct(reflect.TypeOf(TrafficManagerProfile_STATUS{}), generators)

	return trafficManagerProfile_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForTrafficManagerProfile_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForTrafficManagerProfile_STATUS(gens map[string]gopter.Gen) {
	gens["AllowedEndpointRecordTypes"] = gen.SliceOf(gen.AlphaString())
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["Location"] = gen.PtrOf(gen.AlphaString())
	gens["MaxReturn"] = gen.PtrOf(gen.Int())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["ProfileStatus"] = gen.PtrOf(gen.AlphaString())
	gens["Tags"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
	gens["TrafficRoutingMethod"] = gen.PtrOf(gen.AlphaString())
	gens["TrafficViewEnrollmentStatus"] = gen.PtrOf(gen.AlphaString())
	gens["Type"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForTrafficManagerProfile_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForTrafficManagerProfile_STATUS(gens map[string]gopter.Gen) {
	gens["DnsConfig"] = gen.PtrOf(DnsConfig_STATUSGenerator())
	gens["Endpoints"] = gen.SliceOf(Endpoint_STATUSGenerator())
	gens["MonitorConfig"] = gen.PtrOf(MonitorConfig_STATUSGenerator())
}

func Test_TrafficManagerProfile_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MinSuccessfulTests = 80
	parameters.MaxSize = 3
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip of TrafficManagerProfile_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForTrafficManagerProfile_Spec, TrafficManagerProfile_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual TrafficManagerProfile_Spec
	err = json.Unmarshal(bin, &actual)
	if err != nil {
		return err.Error()
	}

	// Check for outcome
	match := cmp.Equal(subject, actual, cmpopts.EquateEmpty())
	if !match {
		actualFmt := pretty.Sprint(actual)
		subjectFmt := pretty.Sprint(subject)
		result := diff.Diff(subjectFmt, actualFmt)
		return result
	}

	return ""
}

// Generator of TrafficManagerProfile_Spec instances for property testing - lazily instantiated by
// TrafficManagerProfile_SpecGenerator()
var trafficManagerProfile_SpecGenerator gopter.Gen

// TrafficManagerProfile_SpecGenerator returns a generator of TrafficManagerProfile_Spec instances for property testing.
// We first initialize trafficManagerProfile_SpecGenerator with a simplified generator based on the
// fields with primitive types then replacing it with a more complex one that also handles complex fields
// to ensure any cycles in the object graph properly terminate.
func TrafficManagerProfile_SpecGenerator() gopter.Gen {
	if trafficManagerProfile_SpecGenerator != nil {
		return trafficManagerProfile_SpecGenerator
	}

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForTrafficManagerProfile_Spec(generators)
	AddRelatedPropertyGeneratorsForTrafficManagerProfile_Spec(generators)
	trafficManagerProfile_SpecGenerator = gen.Struct(reflect.TypeOf(TrafficManagerProfile_Spec{}), generators)

	return trafficManagerProfile_SpecGenerator
}

// AddIndependentPropertyGeneratorsForTrafficManagerProfile_Spec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForTrafficManagerProfile_Spec(gens map[string]gopter.Gen) {
	gens["AllowedEndpointRecordTypes"] = gen.SliceOf(gen.AlphaString())
	gens["AzureName"] = gen.AlphaString()
	gens["Location"] = gen.PtrOf(gen.AlphaString())
	gens["MaxReturn"] = gen.PtrOf(gen.Int())
	gens["OriginalVersion"] = gen.AlphaString()
	gens["ProfileStatus"] = gen.PtrOf(gen.AlphaString())
	gens["Tags"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
	gens["TrafficRoutingMethod"] = gen.PtrOf(gen.AlphaString())
	gens["TrafficViewEnrollmentStatus"] = gen.PtrOf(gen.AlphaString())
	gens["Type"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForTrafficManagerProfile_Spec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForTrafficManagerProfile_Spec(gens map[string]gopter.Gen) {
	gens["DnsConfig"] = gen.PtrOf(DnsConfigGenerator())
	gens["MonitorConfig"] = gen.PtrOf(MonitorConfigGenerator())
	gens["OperatorSpec"] = gen.PtrOf(TrafficManagerProfileOperatorSpecGenerator())
}
