Added more constructors tests.
This commit is contained in:
parent
b9e4ab4cd1
commit
3dc0f2902e
1 changed files with 10 additions and 1 deletions
|
@ -33,7 +33,9 @@ package net.thauvin.erik.pinboard
|
||||||
|
|
||||||
import org.testng.Assert
|
import org.testng.Assert
|
||||||
import org.testng.annotations.Test
|
import org.testng.annotations.Test
|
||||||
|
import java.nio.file.Files
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
|
import java.util.Properties
|
||||||
|
|
||||||
class PinboardPosterTest {
|
class PinboardPosterTest {
|
||||||
private val url = "http://www.foo.com/"
|
private val url = "http://www.foo.com/"
|
||||||
|
@ -58,11 +60,18 @@ class PinboardPosterTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testDeletePin() {
|
fun testDeletePin() {
|
||||||
val poster = PinboardPoster(localProps)
|
val props = Properties().apply {
|
||||||
|
Files.newInputStream(localProps).use { nis ->
|
||||||
|
load(nis)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var poster = PinboardPoster(props)
|
||||||
|
|
||||||
poster.apiEndPoint = ""
|
poster.apiEndPoint = ""
|
||||||
Assert.assertFalse(poster.deletePin(url), "apiEndPoint: <blank>")
|
Assert.assertFalse(poster.deletePin(url), "apiEndPoint: <blank>")
|
||||||
|
|
||||||
|
poster = PinboardPoster(localProps, Constants.ENV_API_TOKEN)
|
||||||
|
|
||||||
poster.apiEndPoint = Constants.API_ENDPOINT
|
poster.apiEndPoint = Constants.API_ENDPOINT
|
||||||
Assert.assertTrue(poster.deletePin(url), "apiEndPoint: ${Constants.API_ENDPOINT}")
|
Assert.assertTrue(poster.deletePin(url), "apiEndPoint: ${Constants.API_ENDPOINT}")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue