// check no options is handled correctly @Test public void processOptionsNoOptions() { LinkedList<String> options = new LinkedList<String>(); options.add("dummy"); Count count = new Count(); count.processOptions(options); assertFalse(count.isShowQuotas()); }
// check missing arguments is handled correctly @Test public void processOptionsMissingArgs() { LinkedList<String> options = new LinkedList<String>(); Count count = new Count(); try { count.processOptions(options); fail("Count.processOptions - NotEnoughArgumentsException not thrown"); } catch (NotEnoughArgumentsException e) { } assertFalse(count.isShowQuotas()); }
@Test public void processOptionsAll() { LinkedList<String> options = new LinkedList<String>(); options.add("-q"); options.add("-h"); options.add("-t"); options.add("SSD"); options.add("dummy"); Count count = new Count(); count.processOptions(options); assertTrue(count.isShowQuotas()); assertTrue(count.isHumanReadable()); assertTrue(count.isShowQuotabyType()); assertEquals(1, count.getStorageTypes().size()); assertEquals(StorageType.SSD, count.getStorageTypes().get(0)); }