package models

import "testing"

func TestClassifySeverity_SecurityGroupIsCritical(t *testing.T) {
	sev := ClassifySeverity("aws_security_group", "ingress")
	if sev != SeverityCritical {
		t.Fatalf("Expected critical, got %s", sev)
	}
}

func TestClassifySeverity_IAMPolicyIsCritical(t *testing.T) {
	sev := ClassifySeverity("aws_iam_policy", "policy")
	if sev != SeverityCritical {
		t.Fatalf("Expected critical, got %s", sev)
	}
}

func TestClassifySeverity_InstanceTypeIsHigh(t *testing.T) {
	sev := ClassifySeverity("aws_instance", "instance_type")
	if sev != SeverityHigh {
		t.Fatalf("Expected high, got %s", sev)
	}
}

func TestClassifySeverity_AMIIsHigh(t *testing.T) {
	sev := ClassifySeverity("aws_instance", "ami")
	if sev != SeverityHigh {
		t.Fatalf("Expected high, got %s", sev)
	}
}

func TestClassifySeverity_TagsAreLow(t *testing.T) {
	sev := ClassifySeverity("aws_instance", "tags")
	if sev != SeverityLow {
		t.Fatalf("Expected low, got %s", sev)
	}
}

func TestClassifySeverity_UnknownAttrIsMedium(t *testing.T) {
	sev := ClassifySeverity("aws_instance", "some_random_attr")
	if sev != SeverityMedium {
		t.Fatalf("Expected medium, got %s", sev)
	}
}

func TestClassifySeverity_KMSKeyIsCritical(t *testing.T) {
	sev := ClassifySeverity("aws_kms_key", "key_rotation")
	if sev != SeverityCritical {
		t.Fatalf("Expected critical, got %s", sev)
	}
}

func TestClassifySeverity_S3BucketPolicyIsCritical(t *testing.T) {
	sev := ClassifySeverity("aws_s3_bucket_policy", "policy")
	if sev != SeverityCritical {
		t.Fatalf("Expected critical, got %s", sev)
	}
}
