GetDouble() public method

Returns a double that contains the value of the specified variable.
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 returns null.
return double
Example #1
0
        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 { }
 }