package nextcloud

import "testing"

func TestIsExternalShare(t *testing.T) {
	if !IsExternalShare(ShareInfo{ShareType: 3, AccessMode: "public"}) {
		t.Fatal("public link should be external")
	}
	if IsExternalShare(ShareInfo{ShareType: 3, Label: "internal", AccessMode: "internal"}) {
		t.Fatal("internal link should not be external")
	}
	if !IsExternalShare(ShareInfo{ShareType: 4}) {
		t.Fatal("email share should be external")
	}
	if IsExternalShare(ShareInfo{ShareType: 0}) {
		t.Fatal("user share should not be external")
	}
}
