// 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_DynamicMetricCriteria_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 DynamicMetricCriteria_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDynamicMetricCriteria_STATUS, DynamicMetricCriteria_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual DynamicMetricCriteria_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 DynamicMetricCriteria_STATUS instances for property testing - lazily instantiated by
// DynamicMetricCriteria_STATUSGenerator()
var dynamicMetricCriteria_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForDynamicMetricCriteria_STATUS(generators)
	AddRelatedPropertyGeneratorsForDynamicMetricCriteria_STATUS(generators)
	dynamicMetricCriteria_STATUSGenerator = gen.Struct(reflect.TypeOf(DynamicMetricCriteria_STATUS{}), generators)

	return dynamicMetricCriteria_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForDynamicMetricCriteria_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForDynamicMetricCriteria_STATUS(gens map[string]gopter.Gen) {
	gens["AlertSensitivity"] = gen.PtrOf(gen.OneConstOf(DynamicMetricCriteria_AlertSensitivity_STATUS_High, DynamicMetricCriteria_AlertSensitivity_STATUS_Low, DynamicMetricCriteria_AlertSensitivity_STATUS_Medium))
	gens["CriterionType"] = gen.OneConstOf(DynamicMetricCriteria_CriterionType_STATUS_DynamicThresholdCriterion)
	gens["IgnoreDataBefore"] = gen.PtrOf(gen.AlphaString())
	gens["MetricName"] = gen.PtrOf(gen.AlphaString())
	gens["MetricNamespace"] = gen.PtrOf(gen.AlphaString())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["Operator"] = gen.PtrOf(gen.OneConstOf(DynamicMetricCriteria_Operator_STATUS_GreaterOrLessThan, DynamicMetricCriteria_Operator_STATUS_GreaterThan, DynamicMetricCriteria_Operator_STATUS_LessThan))
	gens["SkipMetricValidation"] = gen.PtrOf(gen.Bool())
	gens["TimeAggregation"] = gen.PtrOf(gen.OneConstOf(
		DynamicMetricCriteria_TimeAggregation_STATUS_Average,
		DynamicMetricCriteria_TimeAggregation_STATUS_Count,
		DynamicMetricCriteria_TimeAggregation_STATUS_Maximum,
		DynamicMetricCriteria_TimeAggregation_STATUS_Minimum,
		DynamicMetricCriteria_TimeAggregation_STATUS_Total))
}

// AddRelatedPropertyGeneratorsForDynamicMetricCriteria_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForDynamicMetricCriteria_STATUS(gens map[string]gopter.Gen) {
	gens["Dimensions"] = gen.SliceOf(MetricDimension_STATUSGenerator())
	gens["FailingPeriods"] = gen.PtrOf(DynamicThresholdFailingPeriods_STATUSGenerator())
}

func Test_DynamicThresholdFailingPeriods_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 DynamicThresholdFailingPeriods_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDynamicThresholdFailingPeriods_STATUS, DynamicThresholdFailingPeriods_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual DynamicThresholdFailingPeriods_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 DynamicThresholdFailingPeriods_STATUS instances for property testing - lazily instantiated by
// DynamicThresholdFailingPeriods_STATUSGenerator()
var dynamicThresholdFailingPeriods_STATUSGenerator gopter.Gen

// DynamicThresholdFailingPeriods_STATUSGenerator returns a generator of DynamicThresholdFailingPeriods_STATUS instances for property testing.
func DynamicThresholdFailingPeriods_STATUSGenerator() gopter.Gen {
	if dynamicThresholdFailingPeriods_STATUSGenerator != nil {
		return dynamicThresholdFailingPeriods_STATUSGenerator
	}

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

	return dynamicThresholdFailingPeriods_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForDynamicThresholdFailingPeriods_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForDynamicThresholdFailingPeriods_STATUS(gens map[string]gopter.Gen) {
	gens["MinFailingPeriodsToAlert"] = gen.PtrOf(gen.Float64())
	gens["NumberOfEvaluationPeriods"] = gen.PtrOf(gen.Float64())
}

func Test_MetricAlertAction_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 MetricAlertAction_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMetricAlertAction_STATUS, MetricAlertAction_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MetricAlertAction_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 MetricAlertAction_STATUS instances for property testing - lazily instantiated by
// MetricAlertAction_STATUSGenerator()
var metricAlertAction_STATUSGenerator gopter.Gen

// MetricAlertAction_STATUSGenerator returns a generator of MetricAlertAction_STATUS instances for property testing.
func MetricAlertAction_STATUSGenerator() gopter.Gen {
	if metricAlertAction_STATUSGenerator != nil {
		return metricAlertAction_STATUSGenerator
	}

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

	return metricAlertAction_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForMetricAlertAction_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMetricAlertAction_STATUS(gens map[string]gopter.Gen) {
	gens["ActionGroupId"] = gen.PtrOf(gen.AlphaString())
	gens["WebHookProperties"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
}

func Test_MetricAlertCriteria_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 MetricAlertCriteria_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMetricAlertCriteria_STATUS, MetricAlertCriteria_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MetricAlertCriteria_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 MetricAlertCriteria_STATUS instances for property testing - lazily instantiated by
// MetricAlertCriteria_STATUSGenerator()
var metricAlertCriteria_STATUSGenerator gopter.Gen

// MetricAlertCriteria_STATUSGenerator returns a generator of MetricAlertCriteria_STATUS instances for property testing.
func MetricAlertCriteria_STATUSGenerator() gopter.Gen {
	if metricAlertCriteria_STATUSGenerator != nil {
		return metricAlertCriteria_STATUSGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddRelatedPropertyGeneratorsForMetricAlertCriteria_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(MetricAlertCriteria_STATUS{}), props))
	}
	metricAlertCriteria_STATUSGenerator = gen.OneGenOf(gens...)

	return metricAlertCriteria_STATUSGenerator
}

// AddRelatedPropertyGeneratorsForMetricAlertCriteria_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForMetricAlertCriteria_STATUS(gens map[string]gopter.Gen) {
	gens["MicrosoftAzureMonitorMultipleResourceMultipleMetric"] = MetricAlertMultipleResourceMultipleMetricCriteria_STATUSGenerator().Map(func(it MetricAlertMultipleResourceMultipleMetricCriteria_STATUS) *MetricAlertMultipleResourceMultipleMetricCriteria_STATUS {
		return &it
	}) // generate one case for OneOf type
	gens["MicrosoftAzureMonitorSingleResourceMultipleMetric"] = MetricAlertSingleResourceMultipleMetricCriteria_STATUSGenerator().Map(func(it MetricAlertSingleResourceMultipleMetricCriteria_STATUS) *MetricAlertSingleResourceMultipleMetricCriteria_STATUS {
		return &it
	}) // generate one case for OneOf type
	gens["MicrosoftAzureMonitorWebtestLocationAvailability"] = WebtestLocationAvailabilityCriteria_STATUSGenerator().Map(func(it WebtestLocationAvailabilityCriteria_STATUS) *WebtestLocationAvailabilityCriteria_STATUS {
		return &it
	}) // generate one case for OneOf type
}

func Test_MetricAlertMultipleResourceMultipleMetricCriteria_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 MetricAlertMultipleResourceMultipleMetricCriteria_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMetricAlertMultipleResourceMultipleMetricCriteria_STATUS, MetricAlertMultipleResourceMultipleMetricCriteria_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MetricAlertMultipleResourceMultipleMetricCriteria_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 MetricAlertMultipleResourceMultipleMetricCriteria_STATUS instances for property testing - lazily
// instantiated by MetricAlertMultipleResourceMultipleMetricCriteria_STATUSGenerator()
var metricAlertMultipleResourceMultipleMetricCriteria_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForMetricAlertMultipleResourceMultipleMetricCriteria_STATUS(generators)
	AddRelatedPropertyGeneratorsForMetricAlertMultipleResourceMultipleMetricCriteria_STATUS(generators)
	metricAlertMultipleResourceMultipleMetricCriteria_STATUSGenerator = gen.Struct(reflect.TypeOf(MetricAlertMultipleResourceMultipleMetricCriteria_STATUS{}), generators)

	return metricAlertMultipleResourceMultipleMetricCriteria_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForMetricAlertMultipleResourceMultipleMetricCriteria_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMetricAlertMultipleResourceMultipleMetricCriteria_STATUS(gens map[string]gopter.Gen) {
	gens["OdataType"] = gen.OneConstOf(MetricAlertMultipleResourceMultipleMetricCriteria_OdataType_STATUS_MicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria)
}

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

func Test_MetricAlertProperties_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 MetricAlertProperties_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMetricAlertProperties_STATUS, MetricAlertProperties_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MetricAlertProperties_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 MetricAlertProperties_STATUS instances for property testing - lazily instantiated by
// MetricAlertProperties_STATUSGenerator()
var metricAlertProperties_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForMetricAlertProperties_STATUS(generators)
	AddRelatedPropertyGeneratorsForMetricAlertProperties_STATUS(generators)
	metricAlertProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(MetricAlertProperties_STATUS{}), generators)

	return metricAlertProperties_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForMetricAlertProperties_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMetricAlertProperties_STATUS(gens map[string]gopter.Gen) {
	gens["AutoMitigate"] = gen.PtrOf(gen.Bool())
	gens["Description"] = gen.PtrOf(gen.AlphaString())
	gens["Enabled"] = gen.PtrOf(gen.Bool())
	gens["EvaluationFrequency"] = gen.PtrOf(gen.AlphaString())
	gens["IsMigrated"] = gen.PtrOf(gen.Bool())
	gens["LastUpdatedTime"] = gen.PtrOf(gen.AlphaString())
	gens["Scopes"] = gen.SliceOf(gen.AlphaString())
	gens["Severity"] = gen.PtrOf(gen.Int())
	gens["TargetResourceRegion"] = gen.PtrOf(gen.AlphaString())
	gens["TargetResourceType"] = gen.PtrOf(gen.AlphaString())
	gens["WindowSize"] = gen.PtrOf(gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForMetricAlertProperties_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForMetricAlertProperties_STATUS(gens map[string]gopter.Gen) {
	gens["Actions"] = gen.SliceOf(MetricAlertAction_STATUSGenerator())
	gens["Criteria"] = gen.PtrOf(MetricAlertCriteria_STATUSGenerator())
}

func Test_MetricAlertSingleResourceMultipleMetricCriteria_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 MetricAlertSingleResourceMultipleMetricCriteria_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMetricAlertSingleResourceMultipleMetricCriteria_STATUS, MetricAlertSingleResourceMultipleMetricCriteria_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MetricAlertSingleResourceMultipleMetricCriteria_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 MetricAlertSingleResourceMultipleMetricCriteria_STATUS instances for property testing - lazily
// instantiated by MetricAlertSingleResourceMultipleMetricCriteria_STATUSGenerator()
var metricAlertSingleResourceMultipleMetricCriteria_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForMetricAlertSingleResourceMultipleMetricCriteria_STATUS(generators)
	AddRelatedPropertyGeneratorsForMetricAlertSingleResourceMultipleMetricCriteria_STATUS(generators)
	metricAlertSingleResourceMultipleMetricCriteria_STATUSGenerator = gen.Struct(reflect.TypeOf(MetricAlertSingleResourceMultipleMetricCriteria_STATUS{}), generators)

	return metricAlertSingleResourceMultipleMetricCriteria_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForMetricAlertSingleResourceMultipleMetricCriteria_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMetricAlertSingleResourceMultipleMetricCriteria_STATUS(gens map[string]gopter.Gen) {
	gens["OdataType"] = gen.OneConstOf(MetricAlertSingleResourceMultipleMetricCriteria_OdataType_STATUS_MicrosoftAzureMonitorSingleResourceMultipleMetricCriteria)
}

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

func Test_MetricAlert_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 MetricAlert_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMetricAlert_STATUS, MetricAlert_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MetricAlert_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 MetricAlert_STATUS instances for property testing - lazily instantiated by MetricAlert_STATUSGenerator()
var metricAlert_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForMetricAlert_STATUS(generators)
	AddRelatedPropertyGeneratorsForMetricAlert_STATUS(generators)
	metricAlert_STATUSGenerator = gen.Struct(reflect.TypeOf(MetricAlert_STATUS{}), generators)

	return metricAlert_STATUSGenerator
}

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

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

func Test_MetricCriteria_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 MetricCriteria_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMetricCriteria_STATUS, MetricCriteria_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MetricCriteria_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 MetricCriteria_STATUS instances for property testing - lazily instantiated by
// MetricCriteria_STATUSGenerator()
var metricCriteria_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForMetricCriteria_STATUS(generators)
	AddRelatedPropertyGeneratorsForMetricCriteria_STATUS(generators)
	metricCriteria_STATUSGenerator = gen.Struct(reflect.TypeOf(MetricCriteria_STATUS{}), generators)

	return metricCriteria_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForMetricCriteria_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMetricCriteria_STATUS(gens map[string]gopter.Gen) {
	gens["CriterionType"] = gen.OneConstOf(MetricCriteria_CriterionType_STATUS_StaticThresholdCriterion)
	gens["MetricName"] = gen.PtrOf(gen.AlphaString())
	gens["MetricNamespace"] = gen.PtrOf(gen.AlphaString())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["Operator"] = gen.PtrOf(gen.OneConstOf(
		MetricCriteria_Operator_STATUS_Equals,
		MetricCriteria_Operator_STATUS_GreaterThan,
		MetricCriteria_Operator_STATUS_GreaterThanOrEqual,
		MetricCriteria_Operator_STATUS_LessThan,
		MetricCriteria_Operator_STATUS_LessThanOrEqual))
	gens["SkipMetricValidation"] = gen.PtrOf(gen.Bool())
	gens["Threshold"] = gen.PtrOf(gen.Float64())
	gens["TimeAggregation"] = gen.PtrOf(gen.OneConstOf(
		MetricCriteria_TimeAggregation_STATUS_Average,
		MetricCriteria_TimeAggregation_STATUS_Count,
		MetricCriteria_TimeAggregation_STATUS_Maximum,
		MetricCriteria_TimeAggregation_STATUS_Minimum,
		MetricCriteria_TimeAggregation_STATUS_Total))
}

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

func Test_MetricDimension_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 MetricDimension_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMetricDimension_STATUS, MetricDimension_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MetricDimension_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 MetricDimension_STATUS instances for property testing - lazily instantiated by
// MetricDimension_STATUSGenerator()
var metricDimension_STATUSGenerator gopter.Gen

// MetricDimension_STATUSGenerator returns a generator of MetricDimension_STATUS instances for property testing.
func MetricDimension_STATUSGenerator() gopter.Gen {
	if metricDimension_STATUSGenerator != nil {
		return metricDimension_STATUSGenerator
	}

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

	return metricDimension_STATUSGenerator
}

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

func Test_MultiMetricCriteria_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 MultiMetricCriteria_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMultiMetricCriteria_STATUS, MultiMetricCriteria_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MultiMetricCriteria_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 MultiMetricCriteria_STATUS instances for property testing - lazily instantiated by
// MultiMetricCriteria_STATUSGenerator()
var multiMetricCriteria_STATUSGenerator gopter.Gen

// MultiMetricCriteria_STATUSGenerator returns a generator of MultiMetricCriteria_STATUS instances for property testing.
func MultiMetricCriteria_STATUSGenerator() gopter.Gen {
	if multiMetricCriteria_STATUSGenerator != nil {
		return multiMetricCriteria_STATUSGenerator
	}

	generators := make(map[string]gopter.Gen)
	AddRelatedPropertyGeneratorsForMultiMetricCriteria_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(MultiMetricCriteria_STATUS{}), props))
	}
	multiMetricCriteria_STATUSGenerator = gen.OneGenOf(gens...)

	return multiMetricCriteria_STATUSGenerator
}

// AddRelatedPropertyGeneratorsForMultiMetricCriteria_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForMultiMetricCriteria_STATUS(gens map[string]gopter.Gen) {
	gens["Dynamic"] = DynamicMetricCriteria_STATUSGenerator().Map(func(it DynamicMetricCriteria_STATUS) *DynamicMetricCriteria_STATUS {
		return &it
	}) // generate one case for OneOf type
	gens["Static"] = MetricCriteria_STATUSGenerator().Map(func(it MetricCriteria_STATUS) *MetricCriteria_STATUS {
		return &it
	}) // generate one case for OneOf type
}

func Test_WebtestLocationAvailabilityCriteria_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 WebtestLocationAvailabilityCriteria_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForWebtestLocationAvailabilityCriteria_STATUS, WebtestLocationAvailabilityCriteria_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual WebtestLocationAvailabilityCriteria_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 WebtestLocationAvailabilityCriteria_STATUS instances for property testing - lazily instantiated by
// WebtestLocationAvailabilityCriteria_STATUSGenerator()
var webtestLocationAvailabilityCriteria_STATUSGenerator gopter.Gen

// WebtestLocationAvailabilityCriteria_STATUSGenerator returns a generator of WebtestLocationAvailabilityCriteria_STATUS instances for property testing.
func WebtestLocationAvailabilityCriteria_STATUSGenerator() gopter.Gen {
	if webtestLocationAvailabilityCriteria_STATUSGenerator != nil {
		return webtestLocationAvailabilityCriteria_STATUSGenerator
	}

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

	return webtestLocationAvailabilityCriteria_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForWebtestLocationAvailabilityCriteria_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForWebtestLocationAvailabilityCriteria_STATUS(gens map[string]gopter.Gen) {
	gens["ComponentId"] = gen.PtrOf(gen.AlphaString())
	gens["FailedLocationCount"] = gen.PtrOf(gen.Float64())
	gens["OdataType"] = gen.OneConstOf(WebtestLocationAvailabilityCriteria_OdataType_STATUS_MicrosoftAzureMonitorWebtestLocationAvailabilityCriteria)
	gens["WebTestId"] = gen.PtrOf(gen.AlphaString())
}
