Add an initial specification

I guess it's cool, not sure it's doing much for me right now...
This commit is contained in:
Bradlee Speice 2014-11-21 00:12:04 -05:00
parent 8396763c65
commit acbdc10116

View File

@ -2,19 +2,25 @@
* Created by bspeice on 11/20/14. * Created by bspeice on 11/20/14.
*/ */
import org.junit.Test
import org.bspeice.minimalbible.activity.downloader.manager.DLProgressEvent import org.bspeice.minimalbible.activity.downloader.manager.DLProgressEvent
import org.crosswire.jsword.book.Book import org.crosswire.jsword.book.Book
import org.mockito.Mockito import org.mockito.Mockito.mock
import org.junit.Assert import org.jetbrains.spek.api.Spek
import kotlin.test.assertEquals
class DLProgressEventTest { class DLProgressEventSpecs : Spek() {{
val b = Mockito.mock(javaClass<Book>()) given("a DLProgressEvent created with 50% progress and a mock book") {
val mockBook = mock(javaClass<Book>())
val dlEvent = DLProgressEvent(50, mockBook)
Test fun fiftyPercentIsOneEighty() { on("getting the progress in degrees") {
val progressDegrees = dlEvent.toCircular()
val e = DLProgressEvent(50, b) it("should be 180 degrees") {
Assert.assertEquals(180, e.toCircular()) assertEquals(180, progressDegrees)
}
}
} }
} }
}