// 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_ApplicationGatewayIPConfiguration_VirtualNetwork_SubResourceEmbedded_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 ApplicationGatewayIPConfiguration_VirtualNetwork_SubResourceEmbedded via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForApplicationGatewayIPConfiguration_VirtualNetwork_SubResourceEmbedded, ApplicationGatewayIPConfiguration_VirtualNetwork_SubResourceEmbeddedGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ApplicationGatewayIPConfiguration_VirtualNetwork_SubResourceEmbeddedGenerator returns a generator of ApplicationGatewayIPConfiguration_VirtualNetwork_SubResourceEmbedded instances for property testing.
func ApplicationGatewayIPConfiguration_VirtualNetwork_SubResourceEmbeddedGenerator() gopter.Gen {
	if applicationGatewayIPConfiguration_VirtualNetwork_SubResourceEmbeddedGenerator != nil {
		return applicationGatewayIPConfiguration_VirtualNetwork_SubResourceEmbeddedGenerator
	}

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

	return applicationGatewayIPConfiguration_VirtualNetwork_SubResourceEmbeddedGenerator
}

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

func Test_DhcpOptions_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 DhcpOptions via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForDhcpOptions, DhcpOptionsGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// DhcpOptionsGenerator returns a generator of DhcpOptions instances for property testing.
func DhcpOptionsGenerator() gopter.Gen {
	if dhcpOptionsGenerator != nil {
		return dhcpOptionsGenerator
	}

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

	return dhcpOptionsGenerator
}

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

func Test_NetworkSecurityGroupSpec_VirtualNetwork_SubResourceEmbedded_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 NetworkSecurityGroupSpec_VirtualNetwork_SubResourceEmbedded via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForNetworkSecurityGroupSpec_VirtualNetwork_SubResourceEmbedded, NetworkSecurityGroupSpec_VirtualNetwork_SubResourceEmbeddedGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// NetworkSecurityGroupSpec_VirtualNetwork_SubResourceEmbeddedGenerator returns a generator of NetworkSecurityGroupSpec_VirtualNetwork_SubResourceEmbedded instances for property testing.
func NetworkSecurityGroupSpec_VirtualNetwork_SubResourceEmbeddedGenerator() gopter.Gen {
	if networkSecurityGroupSpec_VirtualNetwork_SubResourceEmbeddedGenerator != nil {
		return networkSecurityGroupSpec_VirtualNetwork_SubResourceEmbeddedGenerator
	}

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

	return networkSecurityGroupSpec_VirtualNetwork_SubResourceEmbeddedGenerator
}

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

func Test_RouteTableSpec_VirtualNetwork_SubResourceEmbedded_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 RouteTableSpec_VirtualNetwork_SubResourceEmbedded via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForRouteTableSpec_VirtualNetwork_SubResourceEmbedded, RouteTableSpec_VirtualNetwork_SubResourceEmbeddedGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// RouteTableSpec_VirtualNetwork_SubResourceEmbeddedGenerator returns a generator of RouteTableSpec_VirtualNetwork_SubResourceEmbedded instances for property testing.
func RouteTableSpec_VirtualNetwork_SubResourceEmbeddedGenerator() gopter.Gen {
	if routeTableSpec_VirtualNetwork_SubResourceEmbeddedGenerator != nil {
		return routeTableSpec_VirtualNetwork_SubResourceEmbeddedGenerator
	}

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

	return routeTableSpec_VirtualNetwork_SubResourceEmbeddedGenerator
}

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

func Test_ServiceEndpointPolicySpec_VirtualNetwork_SubResourceEmbedded_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 ServiceEndpointPolicySpec_VirtualNetwork_SubResourceEmbedded via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForServiceEndpointPolicySpec_VirtualNetwork_SubResourceEmbedded, ServiceEndpointPolicySpec_VirtualNetwork_SubResourceEmbeddedGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// ServiceEndpointPolicySpec_VirtualNetwork_SubResourceEmbeddedGenerator returns a generator of ServiceEndpointPolicySpec_VirtualNetwork_SubResourceEmbedded instances for property testing.
func ServiceEndpointPolicySpec_VirtualNetwork_SubResourceEmbeddedGenerator() gopter.Gen {
	if serviceEndpointPolicySpec_VirtualNetwork_SubResourceEmbeddedGenerator != nil {
		return serviceEndpointPolicySpec_VirtualNetwork_SubResourceEmbeddedGenerator
	}

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

	return serviceEndpointPolicySpec_VirtualNetwork_SubResourceEmbeddedGenerator
}

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

func Test_SubnetPropertiesFormat_VirtualNetwork_SubResourceEmbedded_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 SubnetPropertiesFormat_VirtualNetwork_SubResourceEmbedded via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSubnetPropertiesFormat_VirtualNetwork_SubResourceEmbedded, SubnetPropertiesFormat_VirtualNetwork_SubResourceEmbeddedGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForSubnetPropertiesFormat_VirtualNetwork_SubResourceEmbedded(generators)
	AddRelatedPropertyGeneratorsForSubnetPropertiesFormat_VirtualNetwork_SubResourceEmbedded(generators)
	subnetPropertiesFormat_VirtualNetwork_SubResourceEmbeddedGenerator = gen.Struct(reflect.TypeOf(SubnetPropertiesFormat_VirtualNetwork_SubResourceEmbedded{}), generators)

	return subnetPropertiesFormat_VirtualNetwork_SubResourceEmbeddedGenerator
}

// AddIndependentPropertyGeneratorsForSubnetPropertiesFormat_VirtualNetwork_SubResourceEmbedded is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForSubnetPropertiesFormat_VirtualNetwork_SubResourceEmbedded(gens map[string]gopter.Gen) {
	gens["AddressPrefix"] = gen.PtrOf(gen.AlphaString())
	gens["AddressPrefixes"] = gen.SliceOf(gen.AlphaString())
	gens["DefaultOutboundAccess"] = gen.PtrOf(gen.Bool())
	gens["PrivateEndpointNetworkPolicies"] = gen.PtrOf(gen.OneConstOf(
		SubnetPropertiesFormat_PrivateEndpointNetworkPolicies_Disabled,
		SubnetPropertiesFormat_PrivateEndpointNetworkPolicies_Enabled,
		SubnetPropertiesFormat_PrivateEndpointNetworkPolicies_NetworkSecurityGroupEnabled,
		SubnetPropertiesFormat_PrivateEndpointNetworkPolicies_RouteTableEnabled))
	gens["PrivateLinkServiceNetworkPolicies"] = gen.PtrOf(gen.OneConstOf(SubnetPropertiesFormat_PrivateLinkServiceNetworkPolicies_Disabled, SubnetPropertiesFormat_PrivateLinkServiceNetworkPolicies_Enabled))
	gens["SharingScope"] = gen.PtrOf(gen.OneConstOf(SubnetPropertiesFormat_SharingScope_DelegatedServices, SubnetPropertiesFormat_SharingScope_Tenant))
}

// AddRelatedPropertyGeneratorsForSubnetPropertiesFormat_VirtualNetwork_SubResourceEmbedded is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForSubnetPropertiesFormat_VirtualNetwork_SubResourceEmbedded(gens map[string]gopter.Gen) {
	gens["ApplicationGatewayIPConfigurations"] = gen.SliceOf(ApplicationGatewayIPConfiguration_VirtualNetwork_SubResourceEmbeddedGenerator())
	gens["Delegations"] = gen.SliceOf(DelegationGenerator())
	gens["IpAllocations"] = gen.SliceOf(SubResourceGenerator())
	gens["NatGateway"] = gen.PtrOf(SubResourceGenerator())
	gens["NetworkSecurityGroup"] = gen.PtrOf(NetworkSecurityGroupSpec_VirtualNetwork_SubResourceEmbeddedGenerator())
	gens["RouteTable"] = gen.PtrOf(RouteTableSpec_VirtualNetwork_SubResourceEmbeddedGenerator())
	gens["ServiceEndpointPolicies"] = gen.SliceOf(ServiceEndpointPolicySpec_VirtualNetwork_SubResourceEmbeddedGenerator())
	gens["ServiceEndpoints"] = gen.SliceOf(ServiceEndpointPropertiesFormatGenerator())
}

func Test_Subnet_VirtualNetwork_SubResourceEmbedded_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 Subnet_VirtualNetwork_SubResourceEmbedded via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForSubnet_VirtualNetwork_SubResourceEmbedded, Subnet_VirtualNetwork_SubResourceEmbeddedGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForSubnet_VirtualNetwork_SubResourceEmbedded(generators)
	AddRelatedPropertyGeneratorsForSubnet_VirtualNetwork_SubResourceEmbedded(generators)
	subnet_VirtualNetwork_SubResourceEmbeddedGenerator = gen.Struct(reflect.TypeOf(Subnet_VirtualNetwork_SubResourceEmbedded{}), generators)

	return subnet_VirtualNetwork_SubResourceEmbeddedGenerator
}

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

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

func Test_VirtualNetworkBgpCommunities_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 VirtualNetworkBgpCommunities via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForVirtualNetworkBgpCommunities, VirtualNetworkBgpCommunitiesGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// VirtualNetworkBgpCommunitiesGenerator returns a generator of VirtualNetworkBgpCommunities instances for property testing.
func VirtualNetworkBgpCommunitiesGenerator() gopter.Gen {
	if virtualNetworkBgpCommunitiesGenerator != nil {
		return virtualNetworkBgpCommunitiesGenerator
	}

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

	return virtualNetworkBgpCommunitiesGenerator
}

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

func Test_VirtualNetworkEncryption_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 VirtualNetworkEncryption via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForVirtualNetworkEncryption, VirtualNetworkEncryptionGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

// VirtualNetworkEncryptionGenerator returns a generator of VirtualNetworkEncryption instances for property testing.
func VirtualNetworkEncryptionGenerator() gopter.Gen {
	if virtualNetworkEncryptionGenerator != nil {
		return virtualNetworkEncryptionGenerator
	}

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

	return virtualNetworkEncryptionGenerator
}

// AddIndependentPropertyGeneratorsForVirtualNetworkEncryption is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForVirtualNetworkEncryption(gens map[string]gopter.Gen) {
	gens["Enabled"] = gen.PtrOf(gen.Bool())
	gens["Enforcement"] = gen.PtrOf(gen.OneConstOf(VirtualNetworkEncryption_Enforcement_AllowUnencrypted, VirtualNetworkEncryption_Enforcement_DropUnencrypted))
}

func Test_VirtualNetworkPeering_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 VirtualNetworkPeering via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForVirtualNetworkPeering, VirtualNetworkPeeringGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForVirtualNetworkPeering(generators)
	AddRelatedPropertyGeneratorsForVirtualNetworkPeering(generators)
	virtualNetworkPeeringGenerator = gen.Struct(reflect.TypeOf(VirtualNetworkPeering{}), generators)

	return virtualNetworkPeeringGenerator
}

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

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

func Test_VirtualNetworkPropertiesFormat_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 VirtualNetworkPropertiesFormat via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForVirtualNetworkPropertiesFormat, VirtualNetworkPropertiesFormatGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

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

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForVirtualNetworkPropertiesFormat(generators)
	AddRelatedPropertyGeneratorsForVirtualNetworkPropertiesFormat(generators)
	virtualNetworkPropertiesFormatGenerator = gen.Struct(reflect.TypeOf(VirtualNetworkPropertiesFormat{}), generators)

	return virtualNetworkPropertiesFormatGenerator
}

// AddIndependentPropertyGeneratorsForVirtualNetworkPropertiesFormat is a factory method for creating gopter generators
func AddIndependentPropertyGeneratorsForVirtualNetworkPropertiesFormat(gens map[string]gopter.Gen) {
	gens["EnableDdosProtection"] = gen.PtrOf(gen.Bool())
	gens["EnableVmProtection"] = gen.PtrOf(gen.Bool())
	gens["FlowTimeoutInMinutes"] = gen.PtrOf(gen.Int())
	gens["PrivateEndpointVNetPolicies"] = gen.PtrOf(gen.OneConstOf(PrivateEndpointVNetPolicies_Basic, PrivateEndpointVNetPolicies_Disabled))
}

// AddRelatedPropertyGeneratorsForVirtualNetworkPropertiesFormat is a factory method for creating gopter generators
func AddRelatedPropertyGeneratorsForVirtualNetworkPropertiesFormat(gens map[string]gopter.Gen) {
	gens["AddressSpace"] = gen.PtrOf(AddressSpaceGenerator())
	gens["BgpCommunities"] = gen.PtrOf(VirtualNetworkBgpCommunitiesGenerator())
	gens["DdosProtectionPlan"] = gen.PtrOf(SubResourceGenerator())
	gens["DhcpOptions"] = gen.PtrOf(DhcpOptionsGenerator())
	gens["Encryption"] = gen.PtrOf(VirtualNetworkEncryptionGenerator())
	gens["IpAllocations"] = gen.SliceOf(SubResourceGenerator())
	gens["Subnets"] = gen.SliceOf(Subnet_VirtualNetwork_SubResourceEmbeddedGenerator())
	gens["VirtualNetworkPeerings"] = gen.SliceOf(VirtualNetworkPeeringGenerator())
}

func Test_VirtualNetwork_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 VirtualNetwork_Spec via JSON returns original",
		prop.ForAll(RunJSONSerializationTestForVirtualNetwork_Spec, VirtualNetwork_SpecGenerator()))
	properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout))
}

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

	// Deserialize back into memory
	var actual VirtualNetwork_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 VirtualNetwork_Spec instances for property testing - lazily instantiated by
// VirtualNetwork_SpecGenerator()
var virtualNetwork_SpecGenerator gopter.Gen

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

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

	// The above call to gen.Struct() captures the map, so create a new one
	generators = make(map[string]gopter.Gen)
	AddIndependentPropertyGeneratorsForVirtualNetwork_Spec(generators)
	AddRelatedPropertyGeneratorsForVirtualNetwork_Spec(generators)
	virtualNetwork_SpecGenerator = gen.Struct(reflect.TypeOf(VirtualNetwork_Spec{}), generators)

	return virtualNetwork_SpecGenerator
}

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

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