-
Notifications
You must be signed in to change notification settings - Fork 177
/
Copy pathWeatherTests.java
28 lines (22 loc) · 1.01 KB
/
WeatherTests.java
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
import java.util.concurrent.*;
import java.util.*;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
final class WeatherTests {
// Do not use sleep-based methods here!
// However, since JUnit expects tests to be synchronous, you will need to wait for the operations to finish
@Test
void todaysWeatherIsSunny() {
// TODO: Test that `Weather.today` returns `"Sunny"`, without changing `Weather.today`
}
@Test
void clickingButtonSetsWeatherToSunny() {
// TODO: Test that `WeatherView.clickButton` sets `WeatherView.weather` to `"Sunny"`, without changing `WeatherView`
}
@Test
void weathersContainsYesterdayAndToday() {
// TODO: Test that `Weather.printWeathers` yields `"Today: Sunny"` and `"Yesterday: Cloudy"` in any order, **changing `Weather.printWeathers` as necessary**
// However, keep the logic of prefixing weathers inside `Weather`; make minimal changes
}
}