From 540b798e397fb787fd81c8e6e636a2343655a42f Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Sat, 19 Feb 2022 16:59:26 -0500 Subject: Made barebones GUI (TabbedView) --- src/test/java/sevenUnitsGUI/PresenterTest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/test/java/sevenUnitsGUI') diff --git a/src/test/java/sevenUnitsGUI/PresenterTest.java b/src/test/java/sevenUnitsGUI/PresenterTest.java index 675e3ab..3e7c2b5 100644 --- a/src/test/java/sevenUnitsGUI/PresenterTest.java +++ b/src/test/java/sevenUnitsGUI/PresenterTest.java @@ -21,6 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.List; import java.util.Optional; +import java.util.Set; import org.junit.jupiter.api.Test; @@ -36,9 +37,9 @@ import sevenUnits.utils.NamedObjectProduct; * @since 2022-02-10 */ public final class PresenterTest { - List testUnits = List.of(Metric.METRE, Metric.KILOMETRE, + Set testUnits = Set.of(Metric.METRE, Metric.KILOMETRE, Metric.METRE_PER_SECOND, Metric.KILOMETRE_PER_HOUR); - List> testDimensions = List.of( + Set> testDimensions = Set.of( Metric.Dimensions.LENGTH.withName(NameSymbol.ofName("Length")), Metric.Dimensions.VELOCITY.withName(NameSymbol.ofName("Velocity"))); @@ -56,12 +57,13 @@ public final class PresenterTest { viewBot.setFromUnits(this.testUnits); viewBot.setToUnits(this.testUnits); viewBot.setDimensions(this.testDimensions); - viewBot.setSelectedDimension(Optional.of(this.testDimensions.get(0))); + viewBot.setSelectedDimension( + Optional.of(this.testDimensions.iterator().next())); // filter to length units only, then get the filtered sets of units presenter.applyDimensionFilter(); - final List fromUnits = viewBot.getFromUnits(); - final List toUnits = viewBot.getToUnits(); + final Set fromUnits = viewBot.getFromUnits(); + final Set toUnits = viewBot.getToUnits(); // test that fromUnits/toUnits is [METRE, KILOMETRE] // HOWEVER I don't care about the order so I'm testing it this way -- cgit v1.2.3