package usecase import "testing" func TestResolveDocumentMIME(t *testing.T) { tests := []struct { name string filename string wantMIME string }{ { name: "Docx", filename: "document.docx", wantMIME: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", }, { name: "Xlsx", filename: "spreadsheet.xlsx", wantMIME: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", }, { name: "Pptx", filename: "presentation.pptx", wantMIME: "application/vnd.openxmlformats-officedocument.presentationml.presentation", }, { name: "Zip", filename: "archive.zip", wantMIME: "application/zip", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got := resolveDocumentMIME(tt.filename, []byte("dummy")) if got != tt.wantMIME { t.Fatalf("resolveDocumentMIME() = %q, want %q", got, tt.wantMIME) } }) } }