You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
736 B
37 lines
736 B
package net.pokeranalytics.android
|
|
|
|
|
|
open class RealmUnitTest {
|
|
|
|
/*
|
|
@get:Rule
|
|
var rule = PowerMockRule()
|
|
|
|
lateinit var mockRealm: Realm
|
|
|
|
@Before
|
|
fun setup() {
|
|
mockStatic(RealmLog::class.java)
|
|
mockStatic(Realm::class.java)
|
|
|
|
val mockRealm = PowerMockito.mock(Realm::class.java)
|
|
`when`(Realm.getDefaultInstance()).thenReturn(mockRealm)
|
|
this.mockRealm = mockRealm
|
|
}
|
|
|
|
@Test
|
|
fun shouldBeAbleToCreateARealmObject() {
|
|
val session = Session()
|
|
`when`(mockRealm.createObject(Session::class.java)).thenReturn(session)
|
|
val output = mockRealm.createObject(Session::class.java)
|
|
assertThat(output, org.hamcrest.CoreMatchers.`is`(session))
|
|
}
|
|
|
|
@After
|
|
@Throws(Exception::class)
|
|
fun tearDown() {
|
|
mockRealm.close()
|
|
}
|
|
*/
|
|
|
|
} |