77use ProgrammatorDev \OpenWeatherMap \Entity \AirPollution \AirPollution ;
88use ProgrammatorDev \OpenWeatherMap \Entity \AirPollution \AirPollutionList ;
99use ProgrammatorDev \OpenWeatherMap \Entity \AirPollution \AirQuality ;
10- use ProgrammatorDev \OpenWeatherMap \Entity \AirPollution \Component ;
1110use ProgrammatorDev \OpenWeatherMap \Entity \AirPollution \CurrentAirPollution ;
1211use ProgrammatorDev \OpenWeatherMap \Entity \Coordinate ;
1312use ProgrammatorDev \OpenWeatherMap \Entity \Location ;
@@ -131,6 +130,15 @@ private function assertCurrentResponse(CurrentAirPollution $response): void
131130 {
132131 $ this ->assertInstanceOf (CurrentAirPollution::class, $ response );
133132
133+ $ this ->assertSame (196.93 , $ response ->getCarbonMonoxide ());
134+ $ this ->assertSame (0.65 , $ response ->getNitrogenMonoxide ());
135+ $ this ->assertSame (3.98 , $ response ->getNitrogenDioxide ());
136+ $ this ->assertSame (107.29 , $ response ->getOzone ());
137+ $ this ->assertSame (1.46 , $ response ->getSulphurDioxide ());
138+ $ this ->assertSame (8.58 , $ response ->getFineParticulateMatter ());
139+ $ this ->assertSame (13.5 , $ response ->getCoarseParticulateMatter ());
140+ $ this ->assertSame (2.03 , $ response ->getAmmonia ());
141+
134142 $ location = $ response ->getLocation ();
135143 $ this ->assertInstanceOf (Location::class, $ location );
136144 $ this ->assertSame (null , $ location ->getId ());
@@ -156,17 +164,6 @@ private function assertCurrentResponse(CurrentAirPollution $response): void
156164 $ this ->assertInstanceOf (AirQuality::class, $ airQuality );
157165 $ this ->assertSame (3 , $ airQuality ->getIndex ());
158166 $ this ->assertSame ('Moderate ' , $ airQuality ->getQualitativeName ());
159-
160- $ components = $ response ->getComponents ();
161- $ this ->assertInstanceOf (Component::class, $ components );
162- $ this ->assertSame (196.93 , $ components ->getCarbonMonoxide ());
163- $ this ->assertSame (0.65 , $ components ->getNitrogenMonoxide ());
164- $ this ->assertSame (3.98 , $ components ->getNitrogenDioxide ());
165- $ this ->assertSame (107.29 , $ components ->getOzone ());
166- $ this ->assertSame (1.46 , $ components ->getSulphurDioxide ());
167- $ this ->assertSame (8.58 , $ components ->getFineParticulateMatter ());
168- $ this ->assertSame (13.5 , $ components ->getCoarseParticulateMatter ());
169- $ this ->assertSame (2.03 , $ components ->getAmmonia ());
170167 }
171168
172169 private function assertForecastResponse (AirPollutionList $ response ): void
@@ -193,6 +190,15 @@ private function assertForecastResponse(AirPollutionList $response): void
193190 $ list = $ response ->getList ();
194191 $ this ->assertContainsOnlyInstancesOf (AirPollution::class, $ list );
195192
193+ $ this ->assertSame (196.93 , $ list [0 ]->getCarbonMonoxide ());
194+ $ this ->assertSame (0.65 , $ list [0 ]->getNitrogenMonoxide ());
195+ $ this ->assertSame (3.98 , $ list [0 ]->getNitrogenDioxide ());
196+ $ this ->assertSame (107.29 , $ list [0 ]->getOzone ());
197+ $ this ->assertSame (1.46 , $ list [0 ]->getSulphurDioxide ());
198+ $ this ->assertSame (8.58 , $ list [0 ]->getFineParticulateMatter ());
199+ $ this ->assertSame (13.5 , $ list [0 ]->getCoarseParticulateMatter ());
200+ $ this ->assertSame (2.03 , $ list [0 ]->getAmmonia ());
201+
196202 $ dateTime = $ list [0 ]->getDateTime ();
197203 $ this ->assertInstanceOf (\DateTimeImmutable::class, $ dateTime );
198204 $ this ->assertSame ('2023-06-23 17:00:00 ' , $ dateTime ->format ('Y-m-d H:i:s ' ));
@@ -201,17 +207,6 @@ private function assertForecastResponse(AirPollutionList $response): void
201207 $ this ->assertInstanceOf (AirQuality::class, $ airQuality );
202208 $ this ->assertSame (3 , $ airQuality ->getIndex ());
203209 $ this ->assertSame ('Moderate ' , $ airQuality ->getQualitativeName ());
204-
205- $ components = $ list [0 ]->getComponents ();
206- $ this ->assertInstanceOf (Component::class, $ components );
207- $ this ->assertSame (196.93 , $ components ->getCarbonMonoxide ());
208- $ this ->assertSame (0.65 , $ components ->getNitrogenMonoxide ());
209- $ this ->assertSame (3.98 , $ components ->getNitrogenDioxide ());
210- $ this ->assertSame (107.29 , $ components ->getOzone ());
211- $ this ->assertSame (1.46 , $ components ->getSulphurDioxide ());
212- $ this ->assertSame (8.58 , $ components ->getFineParticulateMatter ());
213- $ this ->assertSame (13.5 , $ components ->getCoarseParticulateMatter ());
214- $ this ->assertSame (2.03 , $ components ->getAmmonia ());
215210 }
216211
217212 private function assertHistoryResponse (AirPollutionList $ response ): void
@@ -238,6 +233,15 @@ private function assertHistoryResponse(AirPollutionList $response): void
238233 $ list = $ response ->getList ();
239234 $ this ->assertContainsOnlyInstancesOf (AirPollution::class, $ list );
240235
236+ $ this ->assertSame (220.3 , $ list [0 ]->getCarbonMonoxide ());
237+ $ this ->assertSame (0.12 , $ list [0 ]->getNitrogenMonoxide ());
238+ $ this ->assertSame (3.3 , $ list [0 ]->getNitrogenDioxide ());
239+ $ this ->assertSame (87.26 , $ list [0 ]->getOzone ());
240+ $ this ->assertSame (1.25 , $ list [0 ]->getSulphurDioxide ());
241+ $ this ->assertSame (1.62 , $ list [0 ]->getFineParticulateMatter ());
242+ $ this ->assertSame (2.94 , $ list [0 ]->getCoarseParticulateMatter ());
243+ $ this ->assertSame (0.38 , $ list [0 ]->getAmmonia ());
244+
241245 $ dateTime = $ list [0 ]->getDateTime ();
242246 $ this ->assertInstanceOf (\DateTimeImmutable::class, $ dateTime );
243247 $ this ->assertSame ('2023-06-18 18:00:00 ' , $ dateTime ->format ('Y-m-d H:i:s ' ));
@@ -246,16 +250,5 @@ private function assertHistoryResponse(AirPollutionList $response): void
246250 $ this ->assertInstanceOf (AirQuality::class, $ airQuality );
247251 $ this ->assertSame (2 , $ airQuality ->getIndex ());
248252 $ this ->assertSame ('Fair ' , $ airQuality ->getQualitativeName ());
249-
250- $ components = $ list [0 ]->getComponents ();
251- $ this ->assertInstanceOf (Component::class, $ components );
252- $ this ->assertSame (220.3 , $ components ->getCarbonMonoxide ());
253- $ this ->assertSame (0.12 , $ components ->getNitrogenMonoxide ());
254- $ this ->assertSame (3.3 , $ components ->getNitrogenDioxide ());
255- $ this ->assertSame (87.26 , $ components ->getOzone ());
256- $ this ->assertSame (1.25 , $ components ->getSulphurDioxide ());
257- $ this ->assertSame (1.62 , $ components ->getFineParticulateMatter ());
258- $ this ->assertSame (2.94 , $ components ->getCoarseParticulateMatter ());
259- $ this ->assertSame (0.38 , $ components ->getAmmonia ());
260253 }
261254}
0 commit comments