func TestAccAzureSqlDatabaseServiceAdvanced(t *testing.T) {
	name := "azure_sql_database_service.foo"

	resource.Test(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccCheckAzureSqlDatabaseServiceDeleted,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testAccAzureSqlDatabaseServiceConfigAdvanced,
				Check: resource.ComposeTestCheckFunc(
					testAccAzureSqlDatabaseServerGetName,
					testAccCheckAzureSqlDatabaseServiceExists(name),
					resource.TestCheckResourceAttr(name, "name", "terraform-testing-db"),
					resource.TestCheckResourceAttrPtr(name, "database_server_name",
						testAccAzureSqlServerName),
					resource.TestCheckResourceAttr(name, "edition", "Premium"),
					resource.TestCheckResourceAttr(name, "collation",
						"Arabic_BIN"),
					resource.TestCheckResourceAttr(name, "max_size_bytes", "10737418240"),
					resource.TestCheckResourceAttr(name, "service_level_id",
						"7203483a-c4fb-4304-9e9f-17c71c904f5d"),
				),
			},
		},
	})
}
func TestAccAzureSqlDatabaseServiceUpdate(t *testing.T) {
	name := "azure_sql_database_service.foo"

	resource.Test(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccCheckAzureSqlDatabaseServiceDeleted,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testAccAzureSqlDatabaseServiceConfigAdvanced,
				Check: resource.ComposeTestCheckFunc(
					testAccAzureSqlDatabaseServerGetName,
					testAccCheckAzureSqlDatabaseServiceExists(name),
					resource.TestCheckResourceAttr(name, "name", "terraform-testing-db"),
					resource.TestCheckResourceAttrPtr(name, "database_server_name",
						testAccAzureSqlServerName),
					resource.TestCheckResourceAttr(name, "edition", "Premium"),
					resource.TestCheckResourceAttr(name, "collation",
						"Arabic_BIN"),
					resource.TestCheckResourceAttr(name, "max_size_bytes", "10737418240"),
					resource.TestCheckResourceAttr(name, "service_level_id",
						"7203483a-c4fb-4304-9e9f-17c71c904f5d"),
				),
			},
			resource.TestStep{
				Config: testAccAzureSqlDatabaseServiceConfigUpdate,
				Check: resource.ComposeTestCheckFunc(
					testAccAzureSqlDatabaseServerGetName,
					testAccCheckAzureSqlDatabaseServiceExists(name),
					resource.TestCheckResourceAttr(name, "name",
						"terraform-testing-db-renamed"),
					resource.TestCheckResourceAttrPtr(name, "database_server_name",
						testAccAzureSqlServerName),
					resource.TestCheckResourceAttr(name, "edition", "Standard"),
					resource.TestCheckResourceAttr(name, "collation",
						"SQL_Latin1_General_CP1_CI_AS"),
					resource.TestCheckResourceAttr(name, "max_size_bytes", "5368709120"),
					resource.TestCheckResourceAttr(name, "service_level_id",
						"f1173c43-91bd-4aaa-973c-54e79e15235b"),
				),
			},
		},
	})
}
func TestAccAzureSqlDatabaseServer(t *testing.T) {
	name := "azure_sql_database_server.foo"
	resource.Test(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccCheckAzureSqlDatabaseServerDeleted,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testAccAzureSqlDatabaseServerConfig,
				Check: resource.ComposeTestCheckFunc(
					testAccAzureSqlDatabaseServerGetName,
					testAccCheckAzureSqlDatabaseServerExists(name),
					resource.TestCheckResourceAttrPtr(name, "name", testAccAzureSqlServerName),
					resource.TestCheckResourceAttr(name, "username", "SuperUser"),
					resource.TestCheckResourceAttr(name, "password", "SuperSEKR3T"),
					resource.TestCheckResourceAttr(name, "version", "2.0"),
				),
			},
		},
	})
}
func TestAccAzureSqlDatabaseServiceBasic(t *testing.T) {
	name := "azure_sql_database_service.foo"

	resource.Test(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccCheckAzureSqlDatabaseServiceDeleted,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testAccAzureSqlDatabaseServiceConfigBasic,
				Check: resource.ComposeTestCheckFunc(
					testAccAzureSqlDatabaseServerGetName,
					testAccCheckAzureSqlDatabaseServiceExists(name),
					resource.TestCheckResourceAttr(name, "name", "terraform-testing-db"),
					resource.TestCheckResourceAttrPtr(name, "database_server_name",
						testAccAzureSqlServerName),
					resource.TestCheckResourceAttr(name, "collation",
						"SQL_Latin1_General_CP1_CI_AS"),
					resource.TestCheckResourceAttr(name, "edition", "Standard"),
				),
			},
		},
	})
}