// 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_Multichannel_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 Multichannel_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForMultichannel_STATUS, Multichannel_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual Multichannel_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 Multichannel_STATUS instances for property testing - lazily instantiated by
// Multichannel_STATUSGenerator()
var multichannel_STATUSGenerator gopter.Gen

// Multichannel_STATUSGenerator returns a generator of Multichannel_STATUS instances for property testing.
func Multichannel_STATUSGenerator() gopter.Gen {
	if multichannel_STATUSGenerator != nil {
		return multichannel_STATUSGenerator
	}

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

	return multichannel_STATUSGenerator
}

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

func Test_ProtocolSettings_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 ProtocolSettings_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForProtocolSettings_STATUS, ProtocolSettings_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual ProtocolSettings_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 ProtocolSettings_STATUS instances for property testing - lazily instantiated by
// ProtocolSettings_STATUSGenerator()
var protocolSettings_STATUSGenerator gopter.Gen

// ProtocolSettings_STATUSGenerator returns a generator of ProtocolSettings_STATUS instances for property testing.
func ProtocolSettings_STATUSGenerator() gopter.Gen {
	if protocolSettings_STATUSGenerator != nil {
		return protocolSettings_STATUSGenerator
	}

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

	return protocolSettings_STATUSGenerator
}

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

func Test_SmbSetting_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 SmbSetting_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSmbSetting_STATUS, SmbSetting_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual SmbSetting_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 SmbSetting_STATUS instances for property testing - lazily instantiated by SmbSetting_STATUSGenerator()
var smbSetting_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForSmbSetting_STATUS(generators)
	AddRelatedPropertyGeneratorsForSmbSetting_STATUS(generators)
	smbSetting_STATUSGenerator = gen.Struct(reflect.TypeOf(SmbSetting_STATUS{}), generators)

	return smbSetting_STATUSGenerator
}

// AddIndependentPropertyGeneratorsForSmbSetting_STATUS is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSmbSetting_STATUS(gens map[string]gopter.Gen) {
	gens["AuthenticationMethods"] = gen.PtrOf(gen.AlphaString())
	gens["ChannelEncryption"] = gen.PtrOf(gen.AlphaString())
	gens["KerberosTicketEncryption"] = gen.PtrOf(gen.AlphaString())
	gens["Versions"] = gen.PtrOf(gen.AlphaString())
}

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

func Test_StorageAccountsFileService_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 StorageAccountsFileService_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForStorageAccountsFileService_STATUS, StorageAccountsFileService_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual StorageAccountsFileService_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 StorageAccountsFileService_STATUS instances for property testing - lazily instantiated by
// StorageAccountsFileService_STATUSGenerator()
var storageAccountsFileService_STATUSGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForStorageAccountsFileService_STATUS(generators)
	AddRelatedPropertyGeneratorsForStorageAccountsFileService_STATUS(generators)
	storageAccountsFileService_STATUSGenerator = gen.Struct(reflect.TypeOf(StorageAccountsFileService_STATUS{}), generators)

	return storageAccountsFileService_STATUSGenerator
}

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

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

func Test_StorageAccounts_FileService_Properties_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 StorageAccounts_FileService_Properties_STATUS via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForStorageAccounts_FileService_Properties_STATUS, StorageAccounts_FileService_Properties_STATUSGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual StorageAccounts_FileService_Properties_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 StorageAccounts_FileService_Properties_STATUS instances for property testing - lazily instantiated by
// StorageAccounts_FileService_Properties_STATUSGenerator()
var storageAccounts_FileService_Properties_STATUSGenerator gopter.Gen

// StorageAccounts_FileService_Properties_STATUSGenerator returns a generator of StorageAccounts_FileService_Properties_STATUS instances for property testing.
func StorageAccounts_FileService_Properties_STATUSGenerator() gopter.Gen {
	if storageAccounts_FileService_Properties_STATUSGenerator != nil {
		return storageAccounts_FileService_Properties_STATUSGenerator
	}

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

	return storageAccounts_FileService_Properties_STATUSGenerator
}

// AddRelatedPropertyGeneratorsForStorageAccounts_FileService_Properties_STATUS is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForStorageAccounts_FileService_Properties_STATUS(gens map[string]gopter.Gen) {
	gens["Cors"] = gen.PtrOf(CorsRules_STATUSGenerator())
	gens["ProtocolSettings"] = gen.PtrOf(ProtocolSettings_STATUSGenerator())
	gens["ShareDeleteRetentionPolicy"] = gen.PtrOf(DeleteRetentionPolicy_STATUSGenerator())
}
