Skip to content

Commit 84d911c

Browse files
committed
green
1 parent 80415e0 commit 84d911c

File tree

1 file changed

+11
-1
lines changed
  • tdd_intro/homework/04_weather_client

1 file changed

+11
-1
lines changed

tdd_intro/homework/04_weather_client/test.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,17 @@ unsigned short GetAverageWindDirection(const WeatherSet& set)
190190

191191
double GetMaximumWindSpeed(const WeatherSet& set)
192192
{
193-
return 0;
193+
if (set.empty())
194+
{
195+
return 0;
196+
}
197+
198+
double min = set[0].windSpeed;
199+
for (const auto& w : set)
200+
{
201+
min = std::max(w.windSpeed, min);
202+
}
203+
return min;
194204
}
195205

196206
TEST(Weather, ParseResponseCorrect)

0 commit comments

Comments
 (0)