From 84a7469d4f2a7b39ae124b995d651ed6661479d6 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Wed, 28 Jun 2023 16:19:24 +0200 Subject: [PATCH] Add test for Cost --- .../org/pgpainless/wot/dijkstra/CostTest.kt | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/CostTest.kt diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/CostTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/CostTest.kt new file mode 100644 index 00000000..281e78f1 --- /dev/null +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/CostTest.kt @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2023 Heiko Schaefer +// +// SPDX-License-Identifier: Apache-2.0 + +package org.pgpainless.wot.dijkstra + +import kotlin.test.Test + +class CostTest { + + @Test + fun cost() { + val cost1 = Cost(1, 60) + val cost2 = Cost(1, 120) + + val cost3 = Cost(2, 60) + val cost4 = Cost(2, 120) + + assert(cost1 < cost2) + assert(cost1 > cost3) + + assert(cost2 > cost3) + assert(cost3 < cost4) + + assert(cost1 > cost4) + assert(cost2 > cost4) + } + +} \ No newline at end of file