Skip to content

Commit

Permalink
Add tests for EmbraceUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
bidetofevil committed Nov 14, 2023
1 parent 9034693 commit c4f6651
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.embrace.android.embracesdk.networking
package io.embrace.android.embracesdk.comms.api

import com.google.gson.GsonBuilder
import io.embrace.android.embracesdk.comms.api.EmbraceUrl
import io.embrace.android.embracesdk.comms.api.EmbraceUrlAdapter
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package io.embrace.android.embracesdk.comms.api

import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
import org.junit.Test

internal class EmbraceUrlTest {
@Test
fun `test equality`() {
val embraceUrl1 = EmbraceUrl.create("https://embrace.io")
val embraceUrl2 = EmbraceUrl.create("https://embrace.io")
val embraceUrl3 = EmbraceUrl.create("http://embrace.io")
val embraceUrl4 = EmbraceUrl.create("https://embrace.wtf")
val embraceUrl5 = EmbraceUrl.create("https://embrace.io?err=1")
val embraceUrl6 = EmbraceUrl.create("https://embrace.io:8080")

assertEquals(embraceUrl1, embraceUrl1)
assertEquals(embraceUrl1, embraceUrl2)
assertNotEquals(embraceUrl1, embraceUrl3)
assertNotEquals(embraceUrl1, embraceUrl4)
assertNotEquals(embraceUrl1, embraceUrl5)
assertNotEquals(embraceUrl1, embraceUrl6)
}
}

0 comments on commit c4f6651

Please sign in to comment.