From db04ad8201e308f7e59b93152b816160aecaa590 Mon Sep 17 00:00:00 2001 From: Selim Eser <2211482@stud.hs-mannheim.de> Date: Sun, 9 Jun 2024 19:36:53 +0200 Subject: [PATCH] calc_l_consumption method test implemented and successful --- .../java/de/hs_mannheim/domain/SystemTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/java/de/hs_mannheim/domain/SystemTest.java b/src/test/java/de/hs_mannheim/domain/SystemTest.java index ab7124b..d84d42b 100644 --- a/src/test/java/de/hs_mannheim/domain/SystemTest.java +++ b/src/test/java/de/hs_mannheim/domain/SystemTest.java @@ -68,4 +68,18 @@ public class SystemTest { assertEquals("30.18 h", current_system.travel_time("10115")[1]); // Berlin mit Fahrrad } + @Test + public void calc_l_consumption(){ + + System current_system = new System("35a75437476f12302f72e55d368485db"); + + current_system.set_current_user_zip("68161"); + current_system.set_current_user_car_avg_kmh(100); + current_system.set_current_user_car_l_100km(10); + + assertEquals("8.846 l", current_system.calc_l_consumption("60306")); // Kraftstoffverbrauch nach Frankfurt + assertEquals("58.111 l", current_system.calc_l_consumption("20095")); // Kraftstoffverbrauch nach Hamburg + assertEquals("60.361 l", current_system.calc_l_consumption("10115")); // Kraftstoffverbrauch nach Berlin + } + }