Commit f3e54481 authored by Lukas Bersinger's avatar Lukas Bersinger
Browse files

add simple task model

parent 6f5bbb7c
package ch.ost.rj.mge.miniproject.tasktracker.models
import java.util.*
class Task {
var id: UUID = UUID.randomUUID()
var name: String? = null
var dueDate: Date? = null
var estimatedTimeMinutes: Long = 0
var actualTimeMinutes: Long = 0
fun differenceMinutes(): Long {
return this.actualTimeMinutes - this.estimatedTimeMinutes
}
}
package ch.ost.rj.mge.miniproject.tasktracker.models
import org.junit.Test
import org.junit.Assert.*
class TaskTest {
@Test
fun difference_positive() {
val task = Task()
task.estimatedTimeMinutes = 10
task.actualTimeMinutes = 25
assertEquals(15, task.differenceMinutes())
}
@Test
fun difference_negative() {
val task = Task()
task.estimatedTimeMinutes = 25
task.actualTimeMinutes = 10
assertEquals(-15, task.differenceMinutes())
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment