Added buildUserAgent() test.
This commit is contained in:
parent
0ed7d0c06c
commit
139048d7c4
1 changed files with 19 additions and 0 deletions
|
@ -225,6 +225,25 @@ class AkismetTest {
|
||||||
assertTrue(akismet.submitSpam(mockComment), "submitHam(request)")
|
assertTrue(akismet.submitSpam(mockComment), "submitHam(request)")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testBuildUserAgent() {
|
||||||
|
val libAgent = "${GeneratedVersion.PROJECT}/${GeneratedVersion.VERSION}"
|
||||||
|
assertEquals(
|
||||||
|
akismet.buildUserAgent(), libAgent, "libAgent"
|
||||||
|
)
|
||||||
|
akismet.applicationName = "My App"
|
||||||
|
|
||||||
|
assertEquals(
|
||||||
|
akismet.buildUserAgent(), libAgent, "libAgent, no app"
|
||||||
|
)
|
||||||
|
|
||||||
|
akismet.applicationVersion = "1.0-test"
|
||||||
|
assertEquals(
|
||||||
|
akismet.buildUserAgent(), "${akismet.applicationName}/${akismet.applicationVersion} | $libAgent",
|
||||||
|
"my app"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun dateToGmtTest() {
|
fun dateToGmtTest() {
|
||||||
val localDateTime = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault())
|
val localDateTime = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue