public void getValueAsStringTest() { OptionArray target = new OptionArray("test", "array int 4"); target.setValueFromString("0,1,2,3"); List<OptionInt> elements = new List<OptionInt>(); for (int i = 0; i < target.Count; i++) { elements.Add((OptionInt)target.getOption(i)); } target.setValueFromString(target.getValueAsString()); for (int i = 0; i < target.Count; i++) { Assert.AreEqual(elements[i], target.getOption(i)); Assert.AreEqual(i, ((OptionInt)target.getOption(i)).Value); } }
public void setValueFromStringTest() { OptionArray target = new OptionArray("test", "array int 4"); target.setValueFromString(" 1 ,2 ,3 "); Assert.AreEqual(1, ((OptionInt)target.getOption(0)).Value); Assert.AreEqual(2, ((OptionInt)target.getOption(1)).Value); Assert.AreEqual(3, ((OptionInt)target.getOption(2)).Value); }