public async Task FileStorageGetMimeTypeFromExtension() { var downloader = new MimeTyper(true, MimeTyperLoadMode.File); var ext = await downloader.GetMimeTypeFromExtension("logo-finaleaaa.svg"); Assert.Equal("image/svg+xml", ext); }
public async Task FileStorageGetMimeTypeFromCommonExtension() { var downloader = new MimeTyper(true, MimeTyperLoadMode.File); var ext = await downloader.GetMimeTypeFromExtension("logo-finaleaaa.docx"); Assert.Equal("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ext); }
public async Task GetMimeTypeFromExtension() { var downloader = new MimeTyper(); var ext = await downloader.GetMimeTypeFromExtension("logo-finaleaaa.svg"); Assert.Equal("image/svg+xml", ext); }
public async Task FileStorageGetMimeTypeFromCustomExtension() { var downloader = new MimeTyper(true, MimeTyperLoadMode.File); await downloader.AddCustomMimeType(new MimeTyperItem { Extension = "purple", MimeType = "application/purplesoft-io" }); var ext = await downloader.GetMimeTypeFromExtension("logo-finaleaaa.purple"); Assert.Equal("application/purplesoft-io", ext); }