JAL-3390 unit tests and command and menu refinements
[jalview.git] / test / jalview / ext / rbvi / chimera / ChimeraXCommandsTest.java
index 02a9dd5..16ee0b1 100644 (file)
@@ -316,4 +316,39 @@ public class ChimeraXCommandsTest
             .getCommand(),
             "setattr #1/A:89-92|#2/B:8-9,12-20 res jv_kd '27.3' create true");
   }
+
+  @Test(groups = "Functional")
+  public void testHideAll()
+  {
+    StructureCommandI cmd = testee.hideAll();
+    assertEquals(cmd.getCommand(), "~display all; ~ribbon");
+  }
+
+  @Test(groups = "Functional")
+  public void testHideChain()
+  {
+    StructureCommandI cmd = testee.hideChain("1.1", "B");
+    assertEquals(cmd.getCommand(), "~ribbon #1.1/B");
+  }
+
+  @Test(groups = "Functional")
+  public void testShowStructures()
+  {
+    /*
+     * with nothing excluded
+     */
+    StructureCommandI cmd = testee.showStructures(null);
+    assertEquals(cmd.getCommand(), "ribbon");
+
+    /*
+     * restricted to specified positions
+     */
+    AtomSpecModel restrictTo = new AtomSpecModel();
+    restrictTo.addRange("1.1", 12, 20, "A");
+    restrictTo.addRange("1.1", 30, 35, "A");
+    restrictTo.addRange("2.1", 11, 30, "B");
+    cmd = testee.showStructures(restrictTo);
+    assertEquals(cmd.getCommand(),
+            "ribbon #1.1/A:12-20,30-35|#2.1/B:11-30");
+  }
 }