package builder

import "testing"

func TestEstimateFusionBuildTotals(t *testing.T) {
	h := &Handler{
		dataDir:     t.TempDir(),
		projectRoot: t.TempDir(),
	}
	req := &BuildRequest{
		FusionEnabled:    true,
		FusionOutputName: "MyApp.exe",
		OutputDir:        "exports",
		Obfuscate:        true,
	}
	got := h.estimateFusionBuild(req, "", 5*1024*1024, "MyApp.exe")
	if got.PrepBytes != 5*1024*1024 {
		t.Fatalf("prep bytes: got %d", got.PrepBytes)
	}
	if got.EstimatedTotalBytes <= got.PrepBytes {
		t.Fatalf("total should exceed prep: %d", got.EstimatedTotalBytes)
	}
	if got.OutputFileName != "MyApp.exe" {
		t.Fatalf("output name: %s", got.OutputFileName)
	}
	if got.ExportPath == "" {
		t.Fatal("expected export path")
	}
}
