-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMediaFileEditorProviderTest.kt
More file actions
99 lines (78 loc) · 2.92 KB
/
MediaFileEditorProviderTest.kt
File metadata and controls
99 lines (78 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package dev.twango.jetplay.editor
import com.intellij.testFramework.fixtures.BasePlatformTestCase
class MediaFileEditorProviderTest : BasePlatformTestCase() {
private lateinit var provider: MediaFileEditorProvider
override fun setUp() {
super.setUp()
provider = MediaFileEditorProvider()
}
fun testAcceptsMp4() {
val file = myFixture.addFileToProject("test.mp4", "").virtualFile
assertTrue(provider.accept(project, file))
}
fun testAcceptsWebm() {
val file = myFixture.addFileToProject("test.webm", "").virtualFile
assertTrue(provider.accept(project, file))
}
fun testAcceptsMp3() {
val file = myFixture.addFileToProject("test.mp3", "").virtualFile
assertTrue(provider.accept(project, file))
}
fun testAcceptsOgg() {
val file = myFixture.addFileToProject("test.ogg", "").virtualFile
assertTrue(provider.accept(project, file))
}
fun testAcceptsWav() {
val file = myFixture.addFileToProject("test.wav", "").virtualFile
assertTrue(provider.accept(project, file))
}
fun testRejectsTxt() {
val file = myFixture.addFileToProject("test.txt", "").virtualFile
assertFalse(provider.accept(project, file))
}
fun testRejectsKt() {
val file = myFixture.addFileToProject("test.kt", "").virtualFile
assertFalse(provider.accept(project, file))
}
fun testAcceptsMkv() {
val file = myFixture.addFileToProject("test.mkv", "").virtualFile
assertTrue(provider.accept(project, file))
}
fun testAcceptsAvi() {
val file = myFixture.addFileToProject("test.avi", "").virtualFile
assertTrue(provider.accept(project, file))
}
fun testAcceptsMov() {
val file = myFixture.addFileToProject("test.mov", "").virtualFile
assertTrue(provider.accept(project, file))
}
fun testAcceptsFlac() {
val file = myFixture.addFileToProject("test.flac", "").virtualFile
assertTrue(provider.accept(project, file))
}
fun testAcceptsAac() {
val file = myFixture.addFileToProject("test.aac", "").virtualFile
assertTrue(provider.accept(project, file))
}
fun testAcceptsOpus() {
val file = myFixture.addFileToProject("test.opus", "").virtualFile
assertTrue(provider.accept(project, file))
}
fun testRejectsPng() {
val file = myFixture.addFileToProject("test.png", "").virtualFile
assertFalse(provider.accept(project, file))
}
fun testRejectsJson() {
val file = myFixture.addFileToProject("test.json", "").virtualFile
assertFalse(provider.accept(project, file))
}
fun testEditorTypeId() {
assertEquals("media-player", provider.editorTypeId)
}
fun testPolicy() {
assertEquals(
com.intellij.openapi.fileEditor.FileEditorPolicy.HIDE_DEFAULT_EDITOR,
provider.policy,
)
}
}