// 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_AutoscaleSettings_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 AutoscaleSettings via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForAutoscaleSettings, AutoscaleSettingsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// AutoscaleSettingsGenerator returns a generator of AutoscaleSettings instances for property testing.
func AutoscaleSettingsGenerator() gopter.Gen {
	if autoscaleSettingsGenerator != nil {
		return autoscaleSettingsGenerator
	}

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

	return autoscaleSettingsGenerator
}

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

func Test_CreateUpdateOptions_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 CreateUpdateOptions via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForCreateUpdateOptions, CreateUpdateOptionsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForCreateUpdateOptions(generators)
	AddRelatedPropertyGeneratorsForCreateUpdateOptions(generators)
	createUpdateOptionsGenerator = gen.Struct(reflect.TypeOf(CreateUpdateOptions{}), generators)

	return createUpdateOptionsGenerator
}

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

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

func Test_MongoDBCollectionCreateUpdateProperties_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 MongoDBCollectionCreateUpdateProperties via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMongoDBCollectionCreateUpdateProperties, MongoDBCollectionCreateUpdatePropertiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// MongoDBCollectionCreateUpdatePropertiesGenerator returns a generator of MongoDBCollectionCreateUpdateProperties instances for property testing.
func MongoDBCollectionCreateUpdatePropertiesGenerator() gopter.Gen {
	if mongoDBCollectionCreateUpdatePropertiesGenerator != nil {
		return mongoDBCollectionCreateUpdatePropertiesGenerator
	}

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

	return mongoDBCollectionCreateUpdatePropertiesGenerator
}

// AddRelatedPropertyGeneratorsForMongoDBCollectionCreateUpdateProperties is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForMongoDBCollectionCreateUpdateProperties(gens map[string]gopter.Gen) {
	gens["Options"] = gen.PtrOf(CreateUpdateOptionsGenerator())
	gens["Resource"] = gen.PtrOf(MongoDBCollectionResourceGenerator())
}

func Test_MongoDBCollectionResource_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 MongoDBCollectionResource via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMongoDBCollectionResource, MongoDBCollectionResourceGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForMongoDBCollectionResource(generators)
	AddRelatedPropertyGeneratorsForMongoDBCollectionResource(generators)
	mongoDBCollectionResourceGenerator = gen.Struct(reflect.TypeOf(MongoDBCollectionResource{}), generators)

	return mongoDBCollectionResourceGenerator
}

// AddIndependentPropertyGeneratorsForMongoDBCollectionResource is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMongoDBCollectionResource(gens map[string]gopter.Gen) {
	gens["AnalyticalStorageTtl"] = gen.PtrOf(gen.Int())
	gens["CreateMode"] = gen.PtrOf(gen.OneConstOf(CreateMode_Default, CreateMode_Restore))
	gens["Id"] = gen.PtrOf(gen.AlphaString())
	gens["ShardKey"] = gen.MapOf(
		gen.AlphaString(),
		gen.AlphaString())
}

// AddRelatedPropertyGeneratorsForMongoDBCollectionResource is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForMongoDBCollectionResource(gens map[string]gopter.Gen) {
	gens["Indexes"] = gen.SliceOf(MongoIndexGenerator())
	gens["RestoreParameters"] = gen.PtrOf(RestoreParametersBaseGenerator())
}

func Test_MongoIndex_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 MongoIndex via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMongoIndex, MongoIndexGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// MongoIndexGenerator returns a generator of MongoIndex instances for property testing.
func MongoIndexGenerator() gopter.Gen {
	if mongoIndexGenerator != nil {
		return mongoIndexGenerator
	}

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

	return mongoIndexGenerator
}

// AddRelatedPropertyGeneratorsForMongoIndex is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForMongoIndex(gens map[string]gopter.Gen) {
	gens["Key"] = gen.PtrOf(MongoIndexKeysGenerator())
	gens["Options"] = gen.PtrOf(MongoIndexOptionsGenerator())
}

func Test_MongoIndexKeys_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 MongoIndexKeys via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMongoIndexKeys, MongoIndexKeysGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// MongoIndexKeysGenerator returns a generator of MongoIndexKeys instances for property testing.
func MongoIndexKeysGenerator() gopter.Gen {
	if mongoIndexKeysGenerator != nil {
		return mongoIndexKeysGenerator
	}

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

	return mongoIndexKeysGenerator
}

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

func Test_MongoIndexOptions_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 MongoIndexOptions via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMongoIndexOptions, MongoIndexOptionsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// MongoIndexOptionsGenerator returns a generator of MongoIndexOptions instances for property testing.
func MongoIndexOptionsGenerator() gopter.Gen {
	if mongoIndexOptionsGenerator != nil {
		return mongoIndexOptionsGenerator
	}

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

	return mongoIndexOptionsGenerator
}

// AddIndependentPropertyGeneratorsForMongoIndexOptions is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForMongoIndexOptions(gens map[string]gopter.Gen) {
	gens["ExpireAfterSeconds"] = gen.PtrOf(gen.Int())
	gens["Unique"] = gen.PtrOf(gen.Bool())
}

func Test_MongodbDatabaseCollection_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 MongodbDatabaseCollection_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMongodbDatabaseCollection_Spec, MongodbDatabaseCollection_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual MongodbDatabaseCollection_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 MongodbDatabaseCollection_Spec instances for property testing - lazily instantiated by
// MongodbDatabaseCollection_SpecGenerator()
var mongodbDatabaseCollection_SpecGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForMongodbDatabaseCollection_Spec(generators)
	AddRelatedPropertyGeneratorsForMongodbDatabaseCollection_Spec(generators)
	mongodbDatabaseCollection_SpecGenerator = gen.Struct(reflect.TypeOf(MongodbDatabaseCollection_Spec{}), generators)

	return mongodbDatabaseCollection_SpecGenerator
}

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

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

func Test_RestoreParametersBase_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 RestoreParametersBase via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForRestoreParametersBase, RestoreParametersBaseGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// RestoreParametersBaseGenerator returns a generator of RestoreParametersBase instances for property testing.
func RestoreParametersBaseGenerator() gopter.Gen {
	if restoreParametersBaseGenerator != nil {
		return restoreParametersBaseGenerator
	}

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

	return restoreParametersBaseGenerator
}

// AddIndependentPropertyGeneratorsForRestoreParametersBase is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForRestoreParametersBase(gens map[string]gopter.Gen) {
	gens["RestoreSource"] = gen.PtrOf(gen.AlphaString())
	gens["RestoreTimestampInUtc"] = gen.PtrOf(gen.AlphaString())
	gens["RestoreWithTtlDisabled"] = gen.PtrOf(gen.Bool())
}
