This repository was archived by the owner on Aug 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 253
Expand file tree
/
Copy pathExampleUnitTest.kt
More file actions
52 lines (42 loc) · 1.57 KB
/
ExampleUnitTest.kt
File metadata and controls
52 lines (42 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.example.lemonade
import com.example.lemonade.data.RoundHut
import com.example.lemonade.data.RoundTower
import com.example.lemonade.data.SquareCabin
import org.junit.Test
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun generates_number() {
val squareCabin = SquareCabin(6,50.0)
//println("\nSquare Cabin\n============")
//println("Capacity: ${squareCabin.capacity}")
//println("Material: ${squareCabin.buildingMaterial}")
//println("Has room? ${squareCabin.hasRoom()}")
with(squareCabin){
println("\nSquare Cabin\n============")
println("Capacity: $capacity")
println("Material: $buildingMaterial")
println("Has room? ${hasRoom()}")
println("floorArea? ${floorArea()}")
}
val roundHut = RoundHut(3,10.0)
with(roundHut) {
println("\nRound Hut\n=========")
println("Material: ${buildingMaterial}")
println("Capacity: ${capacity}")
println("Has room? ${hasRoom()}")
println("carpet size ${calculateMaxCarpetLength()}")
}
val roundTower = RoundTower(4,15.5)
with(roundTower) {
println("\nRound Tower\n==========")
println("Material: ${buildingMaterial}")
println("Capacity: ${capacity}")
println("calculateMaxCarpetLength ${calculateMaxCarpetLength()}")
}
}
}