public virtual void FillNonstaticField() { ArgumentParserTest.NonstaticClass x = new ArgumentParserTest.NonstaticClass(); NUnit.Framework.Assert.AreEqual(-1, x.staticOption); ArgumentParser.FillOptions(x, "-option.nonstatic", "42"); NUnit.Framework.Assert.AreEqual(42, x.staticOption); }
public virtual void FillNonstaticFieldFromProperties() { ArgumentParserTest.NonstaticClass x = new ArgumentParserTest.NonstaticClass(); NUnit.Framework.Assert.AreEqual(-1, x.staticOption); Properties props = new Properties(); props.SetProperty("option.nonstatic", "42"); ArgumentParser.FillOptions(x, props); NUnit.Framework.Assert.AreEqual(42, x.staticOption); }
public virtual void CheckOptionsOverrideProperties() { ArgumentParserTest.NonstaticClass x = new ArgumentParserTest.NonstaticClass(); NUnit.Framework.Assert.AreEqual(-1, x.staticOption); Properties props = new Properties(); props.SetProperty("option.nonstatic", "78"); ArgumentParser.FillOptions(x, props, "-option.nonstatic", "42"); NUnit.Framework.Assert.AreEqual(42, x.staticOption); }