package api

import "testing"

func TestShouldUseGatewayAuth(t *testing.T) {
	tests := []struct {
		name           string
		local          bool
		enabledInLocal bool
		want           bool
	}{
		{name: "non-local", want: true},
		{name: "local default", local: true},
		{name: "local gateway", local: true, enabledInLocal: true, want: true},
	}
	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			if got := shouldUseGatewayAuth(test.local, test.enabledInLocal); got != test.want {
				t.Fatalf("shouldUseGatewayAuth(%t, %t) = %t, want %t", test.local, test.enabledInLocal, got, test.want)
			}
		})
	}
}
