package configloader

import (
    "testing"
)

// Ensures institution ID cannot be negative.
// does not exist.
func TestValidateInstitutionIdReturnsErrorOnNegativeInput(t *testing.T) {

    _, err := ValidateInstitutionId(-1, "https://hessen.museum-digital.de")

    if err == nil {
        t.Fatalf("ValidateInstitutionId() accepts should not accept negative IDs (test input: -1)")
    }

}

// Ensures non-existing IDs are rejected.
func TestValidateInstitutionIdReturnsErrorOnNonExistingId(t *testing.T) {

    _, err := ValidateInstitutionId(300000, "https://hessen.museum-digital.de")

    if err == nil {
        t.Fatalf("An institution 300000 should not exist in museum-digital:hessen (otherwise, adjust the test). A non-existing ID should be rejected.")
    }

}
