--- /dev/null
+package net.pterodactylus.fcp;
+
+import org.junit.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+
+public class WatchGlobalTest {
+
+ @Test
+ public void watchGlobalMessageWithOneArgumentHasCorrectName() {
+ WatchGlobal watchGlobal = new WatchGlobal(true);
+ assertThat(watchGlobal.getName(), equalTo("WatchGlobal"));
+ }
+
+ @Test
+ public void watchGlobalMessageWithOneArgumentTrueHasEnabledFieldSetToTrue() {
+ WatchGlobal watchGlobal = new WatchGlobal(true);
+ assertThat(watchGlobal.getField("Enabled"), equalTo("true"));
+ }
+
+ @Test
+ public void watchGlobalMessageWithOneArgumentFalseHasEnabledFieldSetToFalse() {
+ WatchGlobal watchGlobal = new WatchGlobal(false);
+ assertThat(watchGlobal.getField("Enabled"), equalTo("false"));
+ }
+
+ @Test
+ public void watchGlobalMessageWithTwoArgumentsHasCorrectName() {
+ WatchGlobal watchGlobal = new WatchGlobal(true, Verbosity.ALL);
+ assertThat(watchGlobal.getName(), equalTo("WatchGlobal"));
+ }
+
+ @Test
+ public void watchGlobalMessageWithTwoArgumentsTrueAndAllHasTheCorrectFieldsSet() {
+ WatchGlobal watchGlobal = new WatchGlobal(true, Verbosity.ALL);
+ assertThat(watchGlobal.getField("Enabled"), equalTo("true"));
+ assertThat(watchGlobal.getField("VerbosityMask"), equalTo("-1"));
+ }
+
+ @Test
+ public void watchGlobalMessageWithTwoArgumentsFalseAndCompressionHasTheCorrectFieldsSet() {
+ WatchGlobal watchGlobal = new WatchGlobal(false, Verbosity.COMPRESSION);
+ assertThat(watchGlobal.getField("Enabled"), equalTo("false"));
+ assertThat(watchGlobal.getField("VerbosityMask"), equalTo("512"));
+ }
+
+}