Skip to content

Commit

Permalink
test: add test for empty list in extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaGiulianelli committed May 18, 2023
1 parent ee95a46 commit 85177e6
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package usecase.aggregation

import entity.measurements.AggregateData
import entity.measurements.Humidity
import entity.measurements.Luminosity
import entity.measurements.Percentage
Expand Down Expand Up @@ -67,4 +68,13 @@ class AggregateRoomEnvironmentalDataExtractorTest : StringSpec({
"It should be able to extract minimum values from a collection of room environmental data" {
aggregateData.minimum shouldBe minimum
}

"If the list is empty the extractor should work and return an empty instance of data" {
AggregateRoomEnvironmentalDataExtractor(listOf()).aggregate() shouldBe AggregateData(
RoomEnvironmentalData(),
RoomEnvironmentalData(),
RoomEnvironmentalData(),
RoomEnvironmentalData(),
)
}
})

0 comments on commit 85177e6

Please sign in to comment.