From f3d201a0b0803aaa26104b467b16855eaeee407a Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sun, 16 Dec 2018 11:08:25 +0200 Subject: [PATCH] Added tests that reveal why some other tests are failing --- .../settings/changes/ConfigChangeTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Plan/common/src/test/java/com/djrapitops/plan/system/settings/changes/ConfigChangeTest.java b/Plan/common/src/test/java/com/djrapitops/plan/system/settings/changes/ConfigChangeTest.java index d590422a2..cd3f32ab9 100644 --- a/Plan/common/src/test/java/com/djrapitops/plan/system/settings/changes/ConfigChangeTest.java +++ b/Plan/common/src/test/java/com/djrapitops/plan/system/settings/changes/ConfigChangeTest.java @@ -17,6 +17,7 @@ package com.djrapitops.plan.system.settings.changes; import com.djrapitops.plugin.config.Config; +import com.djrapitops.plugin.config.ConfigNode; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -55,6 +56,23 @@ class ConfigChangeTest { assertFalse(new ConfigChange.Moved("Test", "MovedTo").hasBeenApplied(config)); } + @Test + void configParentIsSameObject() { + config = prepareConfig("Test: 'value'"); + ConfigNode node = config.getConfigNode("Test"); + ConfigNode parent = node.getParent(); + assertTrue(parent instanceof Config); + assertSame(config, parent); + } + + @Test + void configParentChildrenIsSameObject() { + config = prepareConfig("Test: 'value'"); + ConfigNode node = config.getConfigNode("Test"); + ConfigNode parent = node.getParent(); + assertSame(config.getChildren(), parent.getChildren()); + } + @Test void moveChangeRecognizesItHasBeenApplied() { config = prepareConfig("Test: 'value'");