File tree 1 file changed +13
-0
lines changed
JunitAndGenericsTaskTree/src/Junit_Less_8/test/java/GenericClasses
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -169,4 +169,17 @@ public void transfer_TransferAllTigerAndServalTypeObjectsToZoosOfOnlyTheirTypes(
169
169
assertEquals (0f , servalZooTwo .getWeightOfAllCatsInZoo (), 0.001 );
170
170
assertEquals (0f , tigerZooTwo .getWeightOfAllCatsInZoo (), 0.001 );
171
171
}
172
+
173
+ @ Test
174
+ public void getFirstElementFromCollections () {
175
+ System .out .println ("------- Тест getFirstElementFromCollections() -------" );
176
+ float testFirstServalWeight = servalZoo .getCats ().get (0 ).getWeight ();
177
+ float testFirstTigerWeight = tigerZoo .getCats ().get (0 ).getWeight ();
178
+ System .out .println ("Вес первого сервала в зоопарке: " + testFirstServalWeight );
179
+ System .out .println ("Вес первого тигра в зоопарке: " + testFirstTigerWeight );
180
+ assertEquals (testFirstServalWeight ,
181
+ Zoo .getFirstElementFromCollections (servalZoo .getCats ()).getWeight (), 0.001 );
182
+ assertEquals (testFirstTigerWeight ,
183
+ Zoo .getFirstElementFromCollections (tigerZoo .getCats ()).getWeight (), 0.001 );
184
+ }
172
185
}
You can’t perform that action at this time.
0 commit comments