resource_group = input("resource_group", value: "", description: "The resource group of the SQL Server.")
sql_server_id = input(:sql_server_id, value: "", description: "The ID of the SQL Server.")
sql_server_name = input(:sql_server_name, value: "", description: "The name of the SQL Server.")

control "azure_sql_database_server_vulnerability_assessments" do
  title "Testing the plural resource of azure_sql_database_server_vulnerability_assessments."
  desc "Testing the plural resource of azure_sql_database_server_vulnerability_assessments."

  describe azure_sql_database_server_vulnerability_assessments(resource_group: resource_group, server_name: sql_server_name) do
    it { should exist }
  end

  describe azure_sql_database_server_vulnerability_assessments(resource_group: resource_group, server_name: sql_server_name) do
    its("ids") { should include "#{sql_server_id}/vulnerabilityAssessments/Default" }
    its("names") { should include "Default" }
    its("types") { should include "Microsoft.Sql/servers/vulnerabilityAssessments" }

    its("isEnabled") { should include false }
    its("emailSubscriptionAdmins") { should include true }
    its("emails") { should_not be_empty }
  end
end
