// 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_ElasticPoolPerDatabaseSettings_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ElasticPoolPerDatabaseSettings to ElasticPoolPerDatabaseSettings via AssignProperties_To_ElasticPoolPerDatabaseSettings & AssignProperties_From_ElasticPoolPerDatabaseSettings returns original",
		prop.ForAll(RunPropertyAssignmentTestForElasticPoolPerDatabaseSettings, ElasticPoolPerDatabaseSettingsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForElasticPoolPerDatabaseSettings tests if a specific instance of ElasticPoolPerDatabaseSettings can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForElasticPoolPerDatabaseSettings(subject ElasticPoolPerDatabaseSettings) 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.ElasticPoolPerDatabaseSettings
	err := copied.AssignProperties_To_ElasticPoolPerDatabaseSettings(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ElasticPoolPerDatabaseSettings
	err = actual.AssignProperties_From_ElasticPoolPerDatabaseSettings(&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_ElasticPoolPerDatabaseSettings_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 ElasticPoolPerDatabaseSettings via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForElasticPoolPerDatabaseSettings, ElasticPoolPerDatabaseSettingsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ElasticPoolPerDatabaseSettingsGenerator returns a generator of ElasticPoolPerDatabaseSettings instances for property testing.
func ElasticPoolPerDatabaseSettingsGenerator() gopter.Gen {
	if elasticPoolPerDatabaseSettingsGenerator != nil {
		return elasticPoolPerDatabaseSettingsGenerator
	}

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

	return elasticPoolPerDatabaseSettingsGenerator
}

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

func Test_ElasticPoolPerDatabaseSettings_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ElasticPoolPerDatabaseSettings_STATUS to ElasticPoolPerDatabaseSettings_STATUS via AssignProperties_To_ElasticPoolPerDatabaseSettings_STATUS & AssignProperties_From_ElasticPoolPerDatabaseSettings_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForElasticPoolPerDatabaseSettings_STATUS, ElasticPoolPerDatabaseSettings_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForElasticPoolPerDatabaseSettings_STATUS tests if a specific instance of ElasticPoolPerDatabaseSettings_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForElasticPoolPerDatabaseSettings_STATUS(subject ElasticPoolPerDatabaseSettings_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.ElasticPoolPerDatabaseSettings_STATUS
	err := copied.AssignProperties_To_ElasticPoolPerDatabaseSettings_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ElasticPoolPerDatabaseSettings_STATUS
	err = actual.AssignProperties_From_ElasticPoolPerDatabaseSettings_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_ElasticPoolPerDatabaseSettings_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 ElasticPoolPerDatabaseSettings_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForElasticPoolPerDatabaseSettings_STATUS, ElasticPoolPerDatabaseSettings_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ElasticPoolPerDatabaseSettings_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 ElasticPoolPerDatabaseSettings_STATUS instances for property testing - lazily instantiated by
// ElasticPoolPerDatabaseSettings_STATUSGenerator()
var elasticPoolPerDatabaseSettings_STATUSGenerator gopter.Gen

// ElasticPoolPerDatabaseSettings_STATUSGenerator returns a generator of ElasticPoolPerDatabaseSettings_STATUS instances for property testing.
func ElasticPoolPerDatabaseSettings_STATUSGenerator() gopter.Gen {
	if elasticPoolPerDatabaseSettings_STATUSGenerator != nil {
		return elasticPoolPerDatabaseSettings_STATUSGenerator
	}

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

	return elasticPoolPerDatabaseSettings_STATUSGenerator
}

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

func Test_ServersElasticPool_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 ServersElasticPool to hub returns original",
		prop.ForAll(RunResourceConversionTestForServersElasticPool, ServersElasticPoolGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

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

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

	// Convert from our hub version
	var actual ServersElasticPool
	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_ServersElasticPool_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersElasticPool to ServersElasticPool via AssignProperties_To_ServersElasticPool & AssignProperties_From_ServersElasticPool returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersElasticPool, ServersElasticPoolGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersElasticPool tests if a specific instance of ServersElasticPool can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersElasticPool(subject ServersElasticPool) 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.ServersElasticPool
	err := copied.AssignProperties_To_ServersElasticPool(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersElasticPool
	err = actual.AssignProperties_From_ServersElasticPool(&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_ServersElasticPool_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 ServersElasticPool via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersElasticPool, ServersElasticPoolGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ServersElasticPoolGenerator returns a generator of ServersElasticPool instances for property testing.
func ServersElasticPoolGenerator() gopter.Gen {
	if serversElasticPoolGenerator != nil {
		return serversElasticPoolGenerator
	}

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

	return serversElasticPoolGenerator
}

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

func Test_ServersElasticPoolOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersElasticPoolOperatorSpec to ServersElasticPoolOperatorSpec via AssignProperties_To_ServersElasticPoolOperatorSpec & AssignProperties_From_ServersElasticPoolOperatorSpec returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersElasticPoolOperatorSpec, ServersElasticPoolOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersElasticPoolOperatorSpec tests if a specific instance of ServersElasticPoolOperatorSpec can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersElasticPoolOperatorSpec(subject ServersElasticPoolOperatorSpec) 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.ServersElasticPoolOperatorSpec
	err := copied.AssignProperties_To_ServersElasticPoolOperatorSpec(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersElasticPoolOperatorSpec
	err = actual.AssignProperties_From_ServersElasticPoolOperatorSpec(&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_ServersElasticPoolOperatorSpec_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 ServersElasticPoolOperatorSpec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersElasticPoolOperatorSpec, ServersElasticPoolOperatorSpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ServersElasticPoolOperatorSpecGenerator returns a generator of ServersElasticPoolOperatorSpec instances for property testing.
func ServersElasticPoolOperatorSpecGenerator() gopter.Gen {
	if serversElasticPoolOperatorSpecGenerator != nil {
		return serversElasticPoolOperatorSpecGenerator
	}

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

	return serversElasticPoolOperatorSpecGenerator
}

func Test_ServersElasticPool_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersElasticPool_STATUS to ServersElasticPool_STATUS via AssignProperties_To_ServersElasticPool_STATUS & AssignProperties_From_ServersElasticPool_STATUS returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersElasticPool_STATUS, ServersElasticPool_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersElasticPool_STATUS tests if a specific instance of ServersElasticPool_STATUS can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersElasticPool_STATUS(subject ServersElasticPool_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.ServersElasticPool_STATUS
	err := copied.AssignProperties_To_ServersElasticPool_STATUS(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersElasticPool_STATUS
	err = actual.AssignProperties_From_ServersElasticPool_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_ServersElasticPool_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 ServersElasticPool_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersElasticPool_STATUS, ServersElasticPool_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ServersElasticPool_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 ServersElasticPool_STATUS instances for property testing - lazily instantiated by
// ServersElasticPool_STATUSGenerator()
var serversElasticPool_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForServersElasticPool_STATUS(generators)
	AddRelatedPropertyGeneratorsForServersElasticPool_STATUS(generators)
	serversElasticPool_STATUSGenerator = gen.Struct(reflect.TypeOf(ServersElasticPool_STATUS{}), generators)

	return serversElasticPool_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForServersElasticPool_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForServersElasticPool_STATUS(gens map[string]gopter.Gen) {
	gens["CreationDate"] = gen.PtrOf(gen.AlphaString())
	gens["HighAvailabilityReplicaCount"] = gen.PtrOf(gen.Int())
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["Kind"] = gen.PtrOf(gen.AlphaString())
	gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ElasticPoolProperties_LicenseType_STATUS_BasePrice, ElasticPoolProperties_LicenseType_STATUS_LicenseIncluded))
	gens["Location"] = gen.PtrOf(gen.AlphaString())
	gens["MaintenanceConfigurationId"] = gen.PtrOf(gen.AlphaString())
	gens["MaxSizeBytes"] = gen.PtrOf(gen.Int())
	gens["MinCapacity"] = gen.PtrOf(gen.Float64())
	gens["Name"] = gen.PtrOf(gen.AlphaString())
	gens["State"] = gen.PtrOf(gen.OneConstOf(ElasticPoolProperties_State_STATUS_Creating, ElasticPoolProperties_State_STATUS_Disabled, ElasticPoolProperties_State_STATUS_Ready))
	gens["Tags"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
	gens["Type"] = gen.PtrOf(gen.AlphaString())
	gens["ZoneRedundant"] = gen.PtrOf(gen.Bool())
}

// AddRelatedPropertyGeneratorsForServersElasticPool_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForServersElasticPool_STATUS(gens map[string]gopter.Gen) {
	gens["PerDatabaseSettings"] = gen.PtrOf(ElasticPoolPerDatabaseSettings_STATUSGenerator())
	gens["Sku"] = gen.PtrOf(Sku_STATUSGenerator())
}

func Test_ServersElasticPool_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
	t.Parallel()
	parameters := gopter.DefaultTestParameters()
	parameters.MaxSize = 10
	properties := gopter.NewProperties(parameters)
	properties.Property(
		"Round trip from ServersElasticPool_Spec to ServersElasticPool_Spec via AssignProperties_To_ServersElasticPool_Spec & AssignProperties_From_ServersElasticPool_Spec returns original",
		prop.ForAll(RunPropertyAssignmentTestForServersElasticPool_Spec, ServersElasticPool_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

// RunPropertyAssignmentTestForServersElasticPool_Spec tests if a specific instance of ServersElasticPool_Spec can be assigned to storage and back losslessly
func RunPropertyAssignmentTestForServersElasticPool_Spec(subject ServersElasticPool_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.ServersElasticPool_Spec
	err := copied.AssignProperties_To_ServersElasticPool_Spec(&other)
	if err != nil {
		return err.Error()
	}

	// Use AssignPropertiesFrom() to convert back to our original type
	var actual ServersElasticPool_Spec
	err = actual.AssignProperties_From_ServersElasticPool_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_ServersElasticPool_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 ServersElasticPool_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServersElasticPool_Spec, ServersElasticPool_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ServersElasticPool_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 ServersElasticPool_Spec instances for property testing - lazily instantiated by
// ServersElasticPool_SpecGenerator()
var serversElasticPool_SpecGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForServersElasticPool_Spec(generators)
	AddRelatedPropertyGeneratorsForServersElasticPool_Spec(generators)
	serversElasticPool_SpecGenerator = gen.Struct(reflect.TypeOf(ServersElasticPool_Spec{}), generators)

	return serversElasticPool_SpecGenerator
}

// AddIndependentPropertyGeneratorsForServersElasticPool_Spec is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForServersElasticPool_Spec(gens map[string]gopter.Gen) {
	gens["AzureName"] = gen.AlphaString()
	gens["HighAvailabilityReplicaCount"] = gen.PtrOf(gen.Int())
	gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ElasticPoolProperties_LicenseType_BasePrice, ElasticPoolProperties_LicenseType_LicenseIncluded))
	gens["Location"] = gen.PtrOf(gen.AlphaString())
	gens["MaintenanceConfigurationId"] = gen.PtrOf(gen.AlphaString())
	gens["MaxSizeBytes"] = gen.PtrOf(gen.Int())
	gens["MinCapacity"] = gen.PtrOf(gen.Float64())
	gens["Tags"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
	gens["ZoneRedundant"] = gen.PtrOf(gen.Bool())
}

// AddRelatedPropertyGeneratorsForServersElasticPool_Spec is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForServersElasticPool_Spec(gens map[string]gopter.Gen) {
	gens["OperatorSpec"] = gen.PtrOf(ServersElasticPoolOperatorSpecGenerator())
	gens["PerDatabaseSettings"] = gen.PtrOf(ElasticPoolPerDatabaseSettingsGenerator())
	gens["Sku"] = gen.PtrOf(SkuGenerator())
}
