File tree Expand file tree Collapse file tree
components/serialization/json/src/test/java/com/microsoft/kiota/serialization Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,4 +172,19 @@ void GetEntityWithUntypedNodesFromJson() throws UnsupportedEncodingException {
172172 }
173173 }
174174 }
175+
176+ @ Test
177+ void getCollectionOfPrimitiveDoubleValues () throws UnsupportedEncodingException {
178+ final var initialString = "{\" values\" :[1.1,2.2,3.3]}" ;
179+ final var rawResponse = new ByteArrayInputStream (initialString .getBytes ("UTF-8" ));
180+ final var parseNode = _parseNodeFactory .getParseNode (contentType , rawResponse );
181+ final var valuesNode = parseNode .getChildNode ("values" );
182+ assertNotNull (valuesNode );
183+ final var doubles = valuesNode .getCollectionOfPrimitiveValues (Double .class );
184+ assertNotNull (doubles );
185+ assertEquals (3 , doubles .size ());
186+ assertEquals (1.1 , doubles .get (0 ), 0.000001 );
187+ assertEquals (2.2 , doubles .get (1 ), 0.000001 );
188+ assertEquals (3.3 , doubles .get (2 ), 0.000001 );
189+ }
175190}
You can’t perform that action at this time.
0 commit comments