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_assessment" do
  title "Testing the singular resource of azure_sql_database_server_vulnerability_assessment."
  desc "Testing the singular resource of azure_sql_database_server_vulnerability_assessment."

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

  describe azure_sql_database_server_vulnerability_assessment(resource_group: resource_group, server_name: sql_server_name) do
    its("id") { should eq sql_server_id }
    its("name") { should eq "Default" }
    its("type") { should eq "Microsoft.Sql/servers/vulnerabilityAssessments" }

    its("properties.recurringScans.isEnabled") { should eq false }
    its("properties.recurringScans.emailSubscriptionAdmins") { should eq true }
    its("properties.recurringScans.emails") { should be_empty }
  end
end
