package domain import "testing" func TestEffectiveContentAccessTier(t *testing.T) { if got := EffectiveContentAccessTier(ContentAccessFree, ContentAccessFree); got != ContentAccessFree { t.Fatalf("expected FREE, got %s", got) } if got := EffectiveContentAccessTier(ContentAccessFree, ContentAccessPremium); got != ContentAccessPremium { t.Fatalf("expected PREMIUM, got %s", got) } if got := EffectiveContentAccessTier(ContentAccessPremium, ContentAccessFree); got != ContentAccessPremium { t.Fatalf("expected cascaded PREMIUM, got %s", got) } } func TestContentAccessTierForRole_openLearnerAlwaysFree(t *testing.T) { if got := ContentAccessTierForRole(RoleOpenLearner, ContentAccessPremium); got != ContentAccessFree { t.Fatalf("OPEN_LEARNER expected FREE, got %s", got) } if got := ContentAccessTierForRole(RoleStudent, ContentAccessPremium); got != ContentAccessPremium { t.Fatalf("STUDENT expected PREMIUM, got %s", got) } }