package system

import (
	"context"
	"testing"
)

func TestAuditSingleZeroDeleteFailsAndSignedBatchIsAccepted(t *testing.T) {
	data := newTransactionTestData(t)
	repo := &auditQueryRepo{data: data}
	ctx := context.Background()

	if err := repo.DeleteOperations(ctx, []int{0}); err == nil {
		t.Fatal("operation single delete with ID zero must fail")
	}
	if err := repo.DeleteLogins(ctx, []int{0}); err == nil {
		t.Fatal("login single delete with ID zero must fail")
	}
	if err := repo.DeleteOperations(ctx, []int{-1}); err != nil {
		t.Fatalf("operation signed batch delete failed: %v", err)
	}
	if err := repo.DeleteLogins(ctx, []int{-1}); err != nil {
		t.Fatalf("login signed batch delete failed: %v", err)
	}
}
