//go:build ignore
{{if .ExcludeTest}}//go:build testAll{{end}}
// Code generated by "gen/generator.go"; DO NOT EDIT.

package provider

import (
	"testing"

	"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

func TestAccDataSourceSdwan{{camelCase .Name}}PolicyObject(t *testing.T) {
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t) },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config: testAccDataSourceSdwan{{camelCase .Name}}PolicyObjectConfig,
				Check: resource.ComposeTestCheckFunc(
					{{- $name := .Name }}
					{{- range  .Attributes}}
					{{- if and (not .WriteOnly) (not .ExcludeTest)}}
					{{- if eq .Type "List"}}
					{{- $list := .TfName }}
					{{- range  .Attributes}}
					{{- if and (not .WriteOnly) (not .ExcludeTest)}}
					{{- if eq .Type "List"}}
					{{- $clist := .TfName }}
					{{- range  .Attributes}}
					{{- if and (not .WriteOnly) (not .ExcludeTest)}}
					resource.TestCheckResourceAttr("data.sdwan_{{snakeCase $name}}_policy_object.test", "{{$list}}.0.{{$clist}}.0.{{.TfName}}", "{{.Example}}"),
					{{- end}}
					{{- end}}
					{{- else}}
					resource.TestCheckResourceAttr("data.sdwan_{{snakeCase $name}}_policy_object.test", "{{$list}}.0.{{.TfName}}", "{{.Example}}"),
					{{- end}}
					{{- end}}
					{{- end}}
					{{- else}}
					resource.TestCheckResourceAttr("data.sdwan_{{snakeCase $name}}_policy_object.test", "{{.TfName}}", "{{.Example}}"),
					{{- end}}
					{{- end}}
					{{- end}}
				),
			},
		},
	})
}

const testAccDataSourceSdwan{{camelCase .Name}}PolicyObjectConfig = `

resource "sdwan_{{snakeCase $name}}_policy_object" "test" {
  name = "TF_TEST_MIN"
{{- range  .Attributes}}
{{- if not .ExcludeTest}}
{{- if eq .Type "List"}}
  {{.TfName}} = [{
    {{- range  .Attributes}}
    {{- if not .ExcludeTest}}
	{{- if eq .Type "List"}}
	{{.TfName}} = [{
		{{- range  .Attributes}}
		{{- if not .ExcludeTest}}
		{{.TfName}} = {{if eq .Type "String"}}"{{end}}{{.Example}}{{if eq .Type "String"}}"{{end}}
		{{- end}}
		{{- end}}
	}]
	{{- else}}
    {{.TfName}} = {{if eq .Type "String"}}"{{end}}{{.Example}}{{if eq .Type "String"}}"{{end}}
    {{- end}}
	{{- end}}
	{{- end}}
  }]
{{- else}}
  {{.TfName}} = {{if eq .Type "String"}}"{{end}}{{.Example}}{{if eq .Type "String"}}"{{end}}
{{- end}}
{{- end}}
{{- end}}
}

data "sdwan_{{snakeCase .Name}}_policy_object" "test" {
  id = sdwan_{{snakeCase $name}}_policy_object.test.id
}
`
