From 3efd2697dd69ee7a8ce87f44a3218cb4baa96e55 Mon Sep 17 00:00:00 2001 From: Mark Whitaker Date: Sun, 6 Feb 2022 13:44:23 +0000 Subject: [PATCH] Add unit tests (#2) * Add audio tests * Add audio/* unit tests * Fix unit test * Add unit tests --- src/test/kotlin/MimeTypesAudioTest.kt | 61 +++++++++++++++++++++++ src/test/kotlin/MimeTypesFontTest.kt | 36 +++++++++++++ src/test/kotlin/MimeTypesImageTest.kt | 41 +++++++++++++++ src/test/kotlin/MimeTypesMultipartTest.kt | 26 ++++++++++ src/test/kotlin/MimeTypesTextTest.kt | 51 +++++++++++++++++++ src/test/kotlin/MimeTypesVideoTest.kt | 41 +++++++++++++++ 6 files changed, 256 insertions(+) create mode 100644 src/test/kotlin/MimeTypesAudioTest.kt create mode 100644 src/test/kotlin/MimeTypesFontTest.kt create mode 100644 src/test/kotlin/MimeTypesImageTest.kt create mode 100644 src/test/kotlin/MimeTypesMultipartTest.kt create mode 100644 src/test/kotlin/MimeTypesTextTest.kt create mode 100644 src/test/kotlin/MimeTypesVideoTest.kt diff --git a/src/test/kotlin/MimeTypesAudioTest.kt b/src/test/kotlin/MimeTypesAudioTest.kt new file mode 100644 index 0000000..df5ac59 --- /dev/null +++ b/src/test/kotlin/MimeTypesAudioTest.kt @@ -0,0 +1,61 @@ +package uk.co.mainwave.mimetypeskotlin + +import org.junit.Assert +import org.junit.Test + +class MimeTypesAudioTest { + @Test + fun testAudioMidi() { + Assert.assertEquals("audio/midi", MimeTypes.Audio.MIDI) + } + + @Test + fun testAudioMp4() { + Assert.assertEquals("audio/mp4", MimeTypes.Audio.MP4) + } + + @Test + fun testAudioMpeg() { + Assert.assertEquals("audio/mpeg", MimeTypes.Audio.MPEG) + } + + @Test + fun testAudioOgg() { + Assert.assertEquals("audio/ogg", MimeTypes.Audio.OGG) + } + + @Test + fun testAudioWav() { + Assert.assertEquals("audio/wav", MimeTypes.Audio.WAV) + } + + @Test + fun testAudioWebm() { + Assert.assertEquals("audio/webm", MimeTypes.Audio.WEBM) + } + + @Test + fun testAudioXAcc() { + Assert.assertEquals("audio/x-aac", MimeTypes.Audio.X_AAC) + } + + @Test + fun testAudioXAiff() { + Assert.assertEquals("audio/x-aiff", MimeTypes.Audio.X_AIFF) + } + + @Test + fun testAudioXMpegurl() { + Assert.assertEquals("audio/x-mpegurl", MimeTypes.Audio.X_MPEGURL) + } + + @Test + fun testAudioXMsWma() { + Assert.assertEquals("audio/x-ms-wma", MimeTypes.Audio.X_MS_WMA) + } + + @Test + fun testAudioXWav() { + Assert.assertEquals("audio/x-wav", MimeTypes.Audio.X_WAV) + } +} \ No newline at end of file diff --git a/src/test/kotlin/MimeTypesFontTest.kt b/src/test/kotlin/MimeTypesFontTest.kt new file mode 100644 index 0000000..0750f6b --- /dev/null +++ b/src/test/kotlin/MimeTypesFontTest.kt @@ -0,0 +1,36 @@ +package uk.co.mainwave.mimetypeskotlin + +import org.junit.Assert +import org.junit.Test + +class MimeTypesFontTest { + @Test + fun testFontCollection() { + Assert.assertEquals("font/collection", MimeTypes.Font.COLLECTION) + } + + @Test + fun testFontOtf() { + Assert.assertEquals("font/otf", MimeTypes.Font.OTF) + } + + @Test + fun testFontSfnt() { + Assert.assertEquals("font/sfnt", MimeTypes.Font.SFNT) + } + + @Test + fun testFontTtf() { + Assert.assertEquals("font/ttf", MimeTypes.Font.TTF) + } + + @Test + fun testFontWoff() { + Assert.assertEquals("font/woff", MimeTypes.Font.WOFF) + } + + @Test + fun testFontWoff2() { + Assert.assertEquals("font/woff2", MimeTypes.Font.WOFF_2) + } +} \ No newline at end of file diff --git a/src/test/kotlin/MimeTypesImageTest.kt b/src/test/kotlin/MimeTypesImageTest.kt new file mode 100644 index 0000000..630eb63 --- /dev/null +++ b/src/test/kotlin/MimeTypesImageTest.kt @@ -0,0 +1,41 @@ +package uk.co.mainwave.mimetypeskotlin + +import org.junit.Assert +import org.junit.Test + +class MimeTypesImageTest { + @Test + fun testImageBmp() { + Assert.assertEquals("image/bmp", MimeTypes.Image.BMP) + } + + @Test + fun testImageGif() { + Assert.assertEquals("image/gif", MimeTypes.Image.GIF) + } + + @Test + fun testImageJpeg() { + Assert.assertEquals("image/jpeg", MimeTypes.Image.JPEG) + } + + @Test + fun testImagePng() { + Assert.assertEquals("image/png", MimeTypes.Image.PNG) + } + + @Test + fun testImageSvgXml() { + Assert.assertEquals("image/svg+xml", MimeTypes.Image.SVG_XML) + } + + @Test + fun testImageTiff() { + Assert.assertEquals("image/tiff", MimeTypes.Image.TIFF) + } + + @Test + fun testImageWebp() { + Assert.assertEquals("image/webp", MimeTypes.Image.WEBP) + } +} \ No newline at end of file diff --git a/src/test/kotlin/MimeTypesMultipartTest.kt b/src/test/kotlin/MimeTypesMultipartTest.kt new file mode 100644 index 0000000..7ac358c --- /dev/null +++ b/src/test/kotlin/MimeTypesMultipartTest.kt @@ -0,0 +1,26 @@ +package uk.co.mainwave.mimetypeskotlin + +import org.junit.Assert +import org.junit.Test + +class MimeTypesMultipartTest { + @Test + fun testMultipartByteranges() { + Assert.assertEquals("multipart/byteranges", MimeTypes.Multipart.BYTERANGES) + } + + @Test + fun testMultipartEncrypted() { + Assert.assertEquals("multipart/encrypted", MimeTypes.Multipart.ENCRYPTED) + } + + @Test + fun testMultipartFormData() { + Assert.assertEquals("multipart/form-data", MimeTypes.Multipart.FORM_DATA) + } + + @Test + fun testMultipartRelated() { + Assert.assertEquals("multipart/related", MimeTypes.Multipart.RELATED) + } +} \ No newline at end of file diff --git a/src/test/kotlin/MimeTypesTextTest.kt b/src/test/kotlin/MimeTypesTextTest.kt new file mode 100644 index 0000000..4639e30 --- /dev/null +++ b/src/test/kotlin/MimeTypesTextTest.kt @@ -0,0 +1,51 @@ +package uk.co.mainwave.mimetypeskotlin + +import org.junit.Assert +import org.junit.Test + +class MimeTypesTextTest { + @Test + fun testTextCss() { + Assert.assertEquals("text/css", MimeTypes.Text.CSS) + } + + @Test + fun testTextCsv() { + Assert.assertEquals("text/csv", MimeTypes.Text.CSV) + } + + @Test + fun testTextHtml() { + Assert.assertEquals("text/html", MimeTypes.Text.HTML) + } + + @Test + fun testTextJavascript() { + Assert.assertEquals("text/javascript", MimeTypes.Text.JAVASCRIPT) + } + + @Test + fun testTextPlain() { + Assert.assertEquals("text/plain", MimeTypes.Text.PLAIN) + } + + @Test + fun testTextRichtext() { + Assert.assertEquals("text/richtext", MimeTypes.Text.RICHTEXT) + } + + @Test + fun testTextSgml() { + Assert.assertEquals("text/sgml", MimeTypes.Text.SGML) + } + + @Test + fun testTextXml() { + Assert.assertEquals("text/xml", MimeTypes.Text.XML) + } + + @Test + fun testTextYaml() { + Assert.assertEquals("text/yaml", MimeTypes.Text.YAML) + } +} \ No newline at end of file diff --git a/src/test/kotlin/MimeTypesVideoTest.kt b/src/test/kotlin/MimeTypesVideoTest.kt new file mode 100644 index 0000000..7c7722d --- /dev/null +++ b/src/test/kotlin/MimeTypesVideoTest.kt @@ -0,0 +1,41 @@ +package uk.co.mainwave.mimetypeskotlin + +import org.junit.Assert +import org.junit.Test + +class MimeTypesVideoTest { + @Test + fun testVideo3gpp() { + Assert.assertEquals("video/3gpp", MimeTypes.Video.THREE_GPP) + } + + @Test + fun testVideoH264() { + Assert.assertEquals("video/h264", MimeTypes.Video.H264) + } + + @Test + fun testVideoMp4() { + Assert.assertEquals("video/mp4", MimeTypes.Video.MP4) + } + + @Test + fun testVideoMpeg() { + Assert.assertEquals("video/mpeg", MimeTypes.Video.MPEG) + } + + @Test + fun testVideoOgg() { + Assert.assertEquals("video/ogg", MimeTypes.Video.OGG) + } + + @Test + fun testVideoQuicktime() { + Assert.assertEquals("video/quicktime", MimeTypes.Video.QUICKTIME) + } + + @Test + fun testVideoWebm() { + Assert.assertEquals("video/webm", MimeTypes.Video.WEBM) + } +} \ No newline at end of file