public GetDouble ( string name, double defaultValue ) : double | ||
name | string | The name of the variable to be read. |
defaultValue | double | The value to be returned if |
return | double |
public void GetDouble() { VariableAccessor va = new VariableAccessor(_testVariableSource); Assert.AreEqual((double)1, va.GetDouble("ValidDouble", 2.0)); Assert.AreEqual((double)2, va.GetDouble("InvalidDouble", 2.0, false)); va.GetDouble("InvalidDouble", 2, true); }
public void GetDouble() { VariableAccessor va = new VariableAccessor(_testVariableSource); Assert.AreEqual((double)1, va.GetDouble("ValidDouble", 2.0)); Assert.AreEqual((double)2, va.GetDouble("InvalidDouble", 2.0, false)); try { va.GetDouble("InvalidDouble", 2, true); Assert.Fail(); } catch { } }