Skip to content

Commit dd70f19

Browse files
committed
Fix test function names for JS
1 parent 6848261 commit dd70f19

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

src/commonTest/kotlin/net/pearx/kpastebin/test/AnonymousTest.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,50 +20,50 @@ import kotlin.test.assertFailsWith
2020

2121
class AnonymousTest {
2222
@Test
23-
fun `getting non-existing paste fails with 404`() = runTest {
23+
fun gettingNonExistingPasteFailsWith404() = runTest {
2424
assertFailsWith<PasteNotFoundException> {
2525
createClient("").getPaste("123")
2626
}
2727
}
2828

2929
@Test
30-
fun `getting paste`() = runTest {
30+
fun gettingPaste() = runTest {
3131
val cl = createClient("")
3232
for ((pasteKey, pasteCode) in pastes) {
3333
assertEquals(pasteCode, cl.getPaste(pasteKey))
3434
}
3535
}
3636

3737
@Test
38-
fun `creating paste with invalid devKey fails`() = runTest {
38+
fun creatingPasteWithInvalidDevKeyFails() = runTest {
3939
assertFailsWith<InvalidDevKeyException> {
4040
createClient("").createPaste("SoMeThInG")
4141
}
4242
}
4343

4444
@Test
45-
fun `creating paste with empty body`() = runTest {
45+
fun creatingPasteWithEmptyBody() = runTest {
4646
assertFailsWith<EmptyPasteException> {
4747
createClient().createPaste("")
4848
}
4949
}
5050

5151
@Test
52-
fun `creating paste with invalid format`() = runTest {
52+
fun creatingPasteWithInvalidFormat() = runTest {
5353
assertFailsWith<InvalidPasteFormatException> {
5454
createClient().createPaste("test", format = "notatext")
5555
}
5656
}
5757

5858
@Test
59-
fun `creating paste with exceeding size limit`() = runTest {
59+
fun creatingPasteWithExceedingSizeLimit() = runTest {
6060
assertFailsWith<PasteSizeException> {
6161
createClient().createPaste("a".repeat(2048))
6262
}
6363
}
6464

6565
@Test
66-
fun `creating paste`() = runTest {
66+
fun creatingPaste() = runTest {
6767
val text = """
6868
class Main {
6969
public static void main() {

src/commonTest/kotlin/net/pearx/kpastebin/test/InvalidUserKeyTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,35 @@ import kotlin.test.assertFailsWith
1616

1717
class InvalidUserKeyTest {
1818
@Test
19-
fun `creating paste`() = runTest {
19+
fun creatingPaste() = runTest {
2020
assertFailsWith<InvalidUserKeyException> {
2121
createClient(userKey = "invalid").createPaste("TEST")
2222
}
2323
}
2424

2525
@Test
26-
fun `listing pastes`() = runTest {
26+
fun listingPastes() = runTest {
2727
assertFailsWith<InvalidUserKeyException> {
2828
createClient(userKey = "invalid").listPastes()
2929
}
3030
}
3131

3232
@Test
33-
fun `deleting paste`() = runTest {
33+
fun deletingPaste() = runTest {
3434
assertFailsWith<InvalidUserKeyException> {
3535
createClient(userKey = "invalid").deletePaste(pastes.keys.first())
3636
}
3737
}
3838

3939
@Test
40-
fun `getting user details`() = runTest {
40+
fun gettingUserDetails() = runTest {
4141
assertFailsWith<InvalidUserKeyException> {
4242
createClient(userKey = "invalid").getUserDetails()
4343
}
4444
}
4545

4646
@Test
47-
fun `getting paste`() = runTest {
47+
fun gettingPaste() = runTest {
4848
assertFailsWith<InvalidUserKeyException> {
4949
createClient(userKey = "invalid").getPaste(pastes.keys.first())
5050
}

src/commonTest/kotlin/net/pearx/kpastebin/test/LoggedInTest.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ import kotlin.test.assertFailsWith
1919

2020
class LoggedInTest {
2121
@Test
22-
fun `creating paste`() = runTest {
22+
fun creatingPaste() = runTest {
2323
createClient(userKey = globalUserKey).createPaste("something")
2424
}
2525

2626
@Test
27-
fun `listing pastes with invalid results limit`() = runTest {
27+
fun listingPastesWithInvalidResultsLimit() = runTest {
2828
assertFailsWith<IllegalArgumentException> {
2929
createClient(userKey = globalUserKey).listPastes(resultsLimit = 0)
3030
}
@@ -34,7 +34,7 @@ class LoggedInTest {
3434
}
3535

3636
@Test
37-
fun `listing pastes`() = runTest {
37+
fun listingPastes() = runTest {
3838
assertEquals(listOf(
3939
PasteDetails(
4040
"0b42rwhf",
@@ -64,27 +64,27 @@ class LoggedInTest {
6464
}
6565

6666
@Test
67-
fun `deleting non-existing paste`() = runTest {
67+
fun deletingNonExistingPaste() = runTest {
6868
assertFailsWith<PasteNotFoundException> {
6969
createClient(userKey = globalUserKey).deletePaste("TEST")
7070
}
7171
}
7272

7373

7474
@Test
75-
fun `deleting paste`() = runTest {
75+
fun deletingPaste() = runTest {
7676
createClient(userKey = globalUserKey).deletePaste(pastes.keys.first())
7777
}
7878

7979
@Test
80-
fun `getting non-existing paste`() = runTest {
80+
fun gettingNonExistingPaste() = runTest {
8181
assertFailsWith<PasteNotFoundException> {
8282
createClient(userKey = globalUserKey).getPaste("TEST")
8383
}
8484
}
8585

8686
@Test
87-
fun `getting user details`() = runTest {
87+
fun gettingUserDetails() = runTest {
8888
assertEquals(UserDetails(
8989
"wiz_kitty",
9090
"text",
@@ -99,7 +99,7 @@ class LoggedInTest {
9999
}
100100

101101
@Test
102-
fun `getting pastes`() = runTest {
102+
fun gettingPastes() = runTest {
103103
for ((key, text) in pastes) {
104104
assertEquals(text, createClient(userKey = globalUserKey).getPaste(key))
105105
}

src/commonTest/kotlin/net/pearx/kpastebin/test/LoginTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ import kotlin.test.assertFailsWith
1616

1717
class LoginTest {
1818
@Test
19-
fun `logging in with inactive credentials`() = runTest {
19+
fun loggingInWithInactiveCredentials() = runTest {
2020
assertFailsWith<AccountNotActiveException> {
2121
createClient().login(inactiveCredentials.first, inactiveCredentials.second)
2222
}
2323
}
2424

2525
@Test
26-
fun `logging in with invalid credentials`() = runTest {
26+
fun loggingInWithInvalidCredentials() = runTest {
2727
assertFailsWith<InvalidLoginException> {
2828
createClient().login("ABC", "DEF")
2929
}
3030
}
3131

3232
@Test
33-
fun `logging in`() = runTest {
33+
fun loggingIn() = runTest {
3434
val cl = createClient()
3535
cl.login(credentials.first, credentials.second)
3636
assertEquals(globalUserKey, cl.userKey)

0 commit comments

Comments
 (0)