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

import (
	"encoding/json"
	storage "github.com/Azure/azure-service-operator/v2/api/sql/v1api20211101/storage"
	"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_ServersAdvancedThreatProtectionSetting_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	parameters.MinSuccessfulTests = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersAdvancedThreatProtectionSetting to hub returns original",
		prop.ForAll(RunResourceConversionTestForServersAdvancedThreatProtectionSetting, ServersAdvancedThreatProtectionSettingGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunResourceConversionTestForServersAdvancedThreatProtectionSetting tests if a specific instance of ServersAdvancedThreatProtectionSetting round trips to the hub storage version and back losslessly
func RunResourceConversionTestForServersAdvancedThreatProtectionSetting(subject ServersAdvancedThreatProtectionSetting) string {
	// Copy subject to make sure conversion doesn't modify it
	copied := subject.DeepCopy()

	// Convert to our hub version
	var hub storage.ServersAdvancedThreatProtectionSetting
	err := copied.ConvertTo(&hub)
	if err != nil {
		return err.Error()
	}

	// Convert from our hub version
	var actual ServersAdvancedThreatProtectionSetting
	err = actual.ConvertFrom(&hub)
	if err != nil {
		return err.Error()
	}

	// Compare actual with what we started with
	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 ""
}

func Test_ServersAdvancedThreatProtectionSetting_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersAdvancedThreatProtectionSetting to ServersAdvancedThreatProtectionSetting via AssignProperties_To_ServersAdvancedThreatProtectionSetting & AssignProperties_From_ServersAdvancedThreatProtectionSetting returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersAdvancedThreatProtectionSetting, ServersAdvancedThreatProtectionSettingGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersAdvancedThreatProtectionSetting tests if a specific instance of ServersAdvancedThreatProtectionSetting can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersAdvancedThreatProtectionSetting(subject ServersAdvancedThreatProtectionSetting) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.ServersAdvancedThreatProtectionSetting
	err := copied.AssignProperties_To_ServersAdvancedThreatProtectionSetting(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersAdvancedThreatProtectionSetting
	err = actual.AssignProperties_From_ServersAdvancedThreatProtectionSetting(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	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 ""
}

func Test_ServersAdvancedThreatProtectionSetting_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 ServersAdvancedThreatProtectionSetting via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersAdvancedThreatProtectionSetting, ServersAdvancedThreatProtectionSettingGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ServersAdvancedThreatProtectionSettingGenerator returns a generator of ServersAdvancedThreatProtectionSetting instances for property testing.
func ServersAdvancedThreatProtectionSettingGenerator() gopter.Gen {
	if serversAdvancedThreatProtectionSettingGenerator != nil {
		return serversAdvancedThreatProtectionSettingGenerator
	}

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

	return serversAdvancedThreatProtectionSettingGenerator
}

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

func Test_ServersAdvancedThreatProtectionSettingOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersAdvancedThreatProtectionSettingOperatorSpec to ServersAdvancedThreatProtectionSettingOperatorSpec via AssignProperties_To_ServersAdvancedThreatProtectionSettingOperatorSpec & AssignProperties_From_ServersAdvancedThreatProtectionSettingOperatorSpec returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersAdvancedThreatProtectionSettingOperatorSpec, ServersAdvancedThreatProtectionSettingOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersAdvancedThreatProtectionSettingOperatorSpec tests if a specific instance of ServersAdvancedThreatProtectionSettingOperatorSpec can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersAdvancedThreatProtectionSettingOperatorSpec(subject ServersAdvancedThreatProtectionSettingOperatorSpec) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.ServersAdvancedThreatProtectionSettingOperatorSpec
	err := copied.AssignProperties_To_ServersAdvancedThreatProtectionSettingOperatorSpec(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersAdvancedThreatProtectionSettingOperatorSpec
	err = actual.AssignProperties_From_ServersAdvancedThreatProtectionSettingOperatorSpec(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	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 ""
}

func Test_ServersAdvancedThreatProtectionSettingOperatorSpec_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 ServersAdvancedThreatProtectionSettingOperatorSpec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersAdvancedThreatProtectionSettingOperatorSpec, ServersAdvancedThreatProtectionSettingOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ServersAdvancedThreatProtectionSettingOperatorSpecGenerator returns a generator of ServersAdvancedThreatProtectionSettingOperatorSpec instances for property testing.
func ServersAdvancedThreatProtectionSettingOperatorSpecGenerator() gopter.Gen {
	if serversAdvancedThreatProtectionSettingOperatorSpecGenerator != nil {
		return serversAdvancedThreatProtectionSettingOperatorSpecGenerator
	}

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

	return serversAdvancedThreatProtectionSettingOperatorSpecGenerator
}

func Test_ServersAdvancedThreatProtectionSetting_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersAdvancedThreatProtectionSetting_STATUS to ServersAdvancedThreatProtectionSetting_STATUS via AssignProperties_To_ServersAdvancedThreatProtectionSetting_STATUS & AssignProperties_From_ServersAdvancedThreatProtectionSetting_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersAdvancedThreatProtectionSetting_STATUS, ServersAdvancedThreatProtectionSetting_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersAdvancedThreatProtectionSetting_STATUS tests if a specific instance of ServersAdvancedThreatProtectionSetting_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersAdvancedThreatProtectionSetting_STATUS(subject ServersAdvancedThreatProtectionSetting_STATUS) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.ServersAdvancedThreatProtectionSetting_STATUS
	err := copied.AssignProperties_To_ServersAdvancedThreatProtectionSetting_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersAdvancedThreatProtectionSetting_STATUS
	err = actual.AssignProperties_From_ServersAdvancedThreatProtectionSetting_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	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 ""
}

func Test_ServersAdvancedThreatProtectionSetting_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 ServersAdvancedThreatProtectionSetting_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersAdvancedThreatProtectionSetting_STATUS, ServersAdvancedThreatProtectionSetting_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ServersAdvancedThreatProtectionSetting_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 ServersAdvancedThreatProtectionSetting_STATUS instances for property testing - lazily instantiated by
// ServersAdvancedThreatProtectionSetting_STATUSGenerator()
var serversAdvancedThreatProtectionSetting_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForServersAdvancedThreatProtectionSetting_STATUS(generators)
	AddRelatedPropertyGeneratorsForServersAdvancedThreatProtectionSetting_STATUS(generators)
	serversAdvancedThreatProtectionSetting_STATUSGenerator = gen.Struct(reflect.TypeOf(ServersAdvancedThreatProtectionSetting_STATUS{}), generators)

	return serversAdvancedThreatProtectionSetting_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForServersAdvancedThreatProtectionSetting_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForServersAdvancedThreatProtectionSetting_STATUS(gens map[string]gopter.Gen) {
	gens["CreationTime"] = gen.PtrOf(gen.AlphaString())
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["State"] = gen.PtrOf(gen.OneConstOf(AdvancedThreatProtectionProperties_State_STATUS_Disabled, AdvancedThreatProtectionProperties_State_STATUS_Enabled, AdvancedThreatProtectionProperties_State_STATUS_New))
	gens["Type"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_ServersAdvancedThreatProtectionSetting_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersAdvancedThreatProtectionSetting_Spec to ServersAdvancedThreatProtectionSetting_Spec via AssignProperties_To_ServersAdvancedThreatProtectionSetting_Spec & AssignProperties_From_ServersAdvancedThreatProtectionSetting_Spec returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersAdvancedThreatProtectionSetting_Spec, ServersAdvancedThreatProtectionSetting_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersAdvancedThreatProtectionSetting_Spec tests if a specific instance of ServersAdvancedThreatProtectionSetting_Spec can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersAdvancedThreatProtectionSetting_Spec(subject ServersAdvancedThreatProtectionSetting_Spec) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.ServersAdvancedThreatProtectionSetting_Spec
	err := copied.AssignProperties_To_ServersAdvancedThreatProtectionSetting_Spec(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersAdvancedThreatProtectionSetting_Spec
	err = actual.AssignProperties_From_ServersAdvancedThreatProtectionSetting_Spec(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	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 ""
}

func Test_ServersAdvancedThreatProtectionSetting_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 ServersAdvancedThreatProtectionSetting_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersAdvancedThreatProtectionSetting_Spec, ServersAdvancedThreatProtectionSetting_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ServersAdvancedThreatProtectionSetting_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 ServersAdvancedThreatProtectionSetting_Spec instances for property testing - lazily instantiated by
// ServersAdvancedThreatProtectionSetting_SpecGenerator()
var serversAdvancedThreatProtectionSetting_SpecGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForServersAdvancedThreatProtectionSetting_Spec(generators)
	AddRelatedPropertyGeneratorsForServersAdvancedThreatProtectionSetting_Spec(generators)
	serversAdvancedThreatProtectionSetting_SpecGenerator = gen.Struct(reflect.TypeOf(ServersAdvancedThreatProtectionSetting_Spec{}), generators)

	return serversAdvancedThreatProtectionSetting_SpecGenerator
}

// AddIndependentPropertyGeneratorsForServersAdvancedThreatProtectionSetting_Spec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForServersAdvancedThreatProtectionSetting_Spec(gens map[string]gopter.Gen) {
	gens["State"] = gen.PtrOf(gen.OneConstOf(AdvancedThreatProtectionProperties_State_Disabled, AdvancedThreatProtectionProperties_State_Enabled, AdvancedThreatProtectionProperties_State_New))
}

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

func Test_SystemData_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from SystemData_STATUS to SystemData_STATUS via AssignProperties_To_SystemData_STATUS & AssignProperties_From_SystemData_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForSystemData_STATUS, SystemData_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForSystemData_STATUS tests if a specific instance of SystemData_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) string {
	// Copy subject to make sure assignment doesn't modify it
	copied := subject.DeepCopy()

	// Use AssignPropertiesTo() for the first stage of conversion
	var other storage.SystemData_STATUS
	err := copied.AssignProperties_To_SystemData_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual SystemData_STATUS
	err = actual.AssignProperties_From_SystemData_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Check for a match
	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 ""
}

func Test_SystemData_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 SystemData_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSystemData_STATUS, SystemData_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual SystemData_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 SystemData_STATUS instances for property testing - lazily instantiated by SystemData_STATUSGenerator()
var systemData_STATUSGenerator gopter.Gen

// SystemData_STATUSGenerator returns a generator of SystemData_STATUS instances for property testing.
func SystemData_STATUSGenerator() gopter.Gen {
	if systemData_STATUSGenerator != nil {
		return systemData_STATUSGenerator
	}

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

	return systemData_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForSystemData_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter.Gen) {
	gens["CreatedAt"] = gen.PtrOf(gen.AlphaString())
	gens["CreatedBy"] = gen.PtrOf(gen.AlphaString())
	gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf(
		SystemData_CreatedByType_STATUS_Application,
		SystemData_CreatedByType_STATUS_Key,
		SystemData_CreatedByType_STATUS_ManagedIdentity,
		SystemData_CreatedByType_STATUS_User))
	gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString())
	gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString())
	gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf(
		SystemData_LastModifiedByType_STATUS_Application,
		SystemData_LastModifiedByType_STATUS_Key,
		SystemData_LastModifiedByType_STATUS_ManagedIdentity,
		SystemData_LastModifiedByType_STATUS_User))
}
