import net.pterodactylus.rhynodge.State
import net.pterodactylus.rhynodge.filters.ResourceLoader.loadDocument
-import net.pterodactylus.rhynodge.webpages.weather.wettercom.WetterComState.WindDirection
import net.pterodactylus.rhynodge.states.FailedState
import net.pterodactylus.rhynodge.states.HtmlState
import org.hamcrest.MatcherAssert.assertThat
import java.time.LocalDateTime
import java.time.Month
-
/**
* Unit test for [WetterComFilter].
*
val newState = filter.filter(htmlState) as WetterComState
assertThat(newState.dateTime, `is`(LocalDateTime.of(2016, Month.MAY, 23, 5, 0)))
assertThat(newState.hours, contains(
- WetterComState.HourState(0, 15.0, 0.65, 0.8, WindDirection.NORTH, 5.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
- WetterComState.HourState(1, 15.0, 0.7, 0.9, WindDirection.NONE, 5.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
- WetterComState.HourState(2, 17.0, 0.75, 1.0, WindDirection.NORTHWEST, 5.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
- WetterComState.HourState(3, 17.0, 0.85, 0.3, WindDirection.NORTHWEST, 5.0, "leichter Regen", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_61_S.png?201605201518"),
- WetterComState.HourState(4, 19.0, 0.9, 0.3, WindDirection.SOUTHWEST, 5.0, "leichter Regen", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_61_S.png?201605201518"),
- WetterComState.HourState(5, 20.0, 0.85, 0.3, WindDirection.SOUTHWEST, 7.0, "leichter Regen", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_61_S.png?201605201518"),
- WetterComState.HourState(6, 20.0, 0.75, 0.3, WindDirection.SOUTHWEST, 11.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
- WetterComState.HourState(7, 20.0, 0.70, 0.3, WindDirection.WEST, 11.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
- WetterComState.HourState(8, 20.0, 0.70, 0.2, WindDirection.WEST, 9.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
- WetterComState.HourState(9, 20.0, 0.70, 0.4, WindDirection.WEST, 5.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
- WetterComState.HourState(10, 20.0, 0.70, 0.4, WindDirection.WEST, 7.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
- WetterComState.HourState(11, 19.0, 0.70, 0.4, WindDirection.WEST, 11.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
- WetterComState.HourState(12, 18.0, 0.70, 0.4, WindDirection.NORTHWEST, 12.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
- WetterComState.HourState(13, 17.0, 0.70, 0.4, WindDirection.NORTHWEST, 11.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
- WetterComState.HourState(14, 16.0, 0.75, 0.4, WindDirection.NORTHWEST, 12.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
- WetterComState.HourState(15, 15.0, 0.85, 0.2, WindDirection.WEST, 12.0, "leichter Regen", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_61_S.png?201605201518"),
- WetterComState.HourState(16, 14.0, 0.9, 0.2, WindDirection.WEST, 14.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
- WetterComState.HourState(17, 14.0, 0.9, 0.2, WindDirection.NORTHWEST, 12.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
- WetterComState.HourState(18, 14.0, 0.9, 0.2, WindDirection.WEST, 12.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
- WetterComState.HourState(19, 13.0, 0.85, 0.1, WindDirection.NORTHWEST, 11.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
- WetterComState.HourState(20, 13.0, 0.8, 0.01, WindDirection.WEST, 11.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
- WetterComState.HourState(21, 12.0, 0.75, 0.2, WindDirection.WEST, 12.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
- WetterComState.HourState(22, 12.0, 0.75, 0.2, WindDirection.NORTHWEST, 12.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
- WetterComState.HourState(23, 11.0, 0.75, 0.2, WindDirection.NORTHWEST, 12.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518")
+ HourState(0, 15.0, 0.65, 0.8, WindDirection.NORTH, 5.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
+ HourState(1, 15.0, 0.7, 0.9, WindDirection.NONE, 5.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
+ HourState(2, 17.0, 0.75, 1.0, WindDirection.NORTHWEST, 5.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
+ HourState(3, 17.0, 0.85, 0.3, WindDirection.NORTHWEST, 5.0, "leichter Regen", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_61_S.png?201605201518"),
+ HourState(4, 19.0, 0.9, 0.3, WindDirection.SOUTHWEST, 5.0, "leichter Regen", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_61_S.png?201605201518"),
+ HourState(5, 20.0, 0.85, 0.3, WindDirection.SOUTHWEST, 7.0, "leichter Regen", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_61_S.png?201605201518"),
+ HourState(6, 20.0, 0.75, 0.3, WindDirection.SOUTHWEST, 11.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
+ HourState(7, 20.0, 0.70, 0.3, WindDirection.WEST, 11.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
+ HourState(8, 20.0, 0.70, 0.2, WindDirection.WEST, 9.0, "leichter Regen-schauer", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_80_S.png?201605201518"),
+ HourState(9, 20.0, 0.70, 0.4, WindDirection.WEST, 5.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
+ HourState(10, 20.0, 0.70, 0.4, WindDirection.WEST, 7.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
+ HourState(11, 19.0, 0.70, 0.4, WindDirection.WEST, 11.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
+ HourState(12, 18.0, 0.70, 0.4, WindDirection.NORTHWEST, 12.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
+ HourState(13, 17.0, 0.70, 0.4, WindDirection.NORTHWEST, 11.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
+ HourState(14, 16.0, 0.75, 0.4, WindDirection.NORTHWEST, 12.0, "Regenschauer", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/d_81_S.png?201605201518"),
+ HourState(15, 15.0, 0.85, 0.2, WindDirection.WEST, 12.0, "leichter Regen", "http://ls1.wettercomassets.com/wcomv5/images/icons/small/d_61_S.png?201605201518"),
+ HourState(16, 14.0, 0.9, 0.2, WindDirection.WEST, 14.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
+ HourState(17, 14.0, 0.9, 0.2, WindDirection.NORTHWEST, 12.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
+ HourState(18, 14.0, 0.9, 0.2, WindDirection.WEST, 12.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
+ HourState(19, 13.0, 0.85, 0.1, WindDirection.NORTHWEST, 11.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
+ HourState(20, 13.0, 0.8, 0.01, WindDirection.WEST, 11.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
+ HourState(21, 12.0, 0.75, 0.2, WindDirection.WEST, 12.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
+ HourState(22, 12.0, 0.75, 0.2, WindDirection.NORTHWEST, 12.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518"),
+ HourState(23, 11.0, 0.75, 0.2, WindDirection.NORTHWEST, 12.0, "leichter Regen", "http://ls2.wettercomassets.com/wcomv5/images/icons/small/n_61_S.png?201605201518")
))
}