Added tests that reveal why some other tests are failing

This commit is contained in:
Rsl1122 2018-12-16 11:08:25 +02:00
parent 4e83fb6f25
commit f3d201a0b0

View File

@ -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'");