GetInt32() public méthode

Returns a int that contains the value of the specified variable.
public GetInt32 ( string name, int defaultValue ) : int
name string The name of the variable to be read.
defaultValue int The value to be returned if returns null.
Résultat int
Exemple #1
0
        public void GetInt32()
        {
            VariableAccessor va = new VariableAccessor(_testVariableSource);

            Assert.AreEqual((int)1, va.GetInt32("ValidInt32", 2));
            Assert.AreEqual((int)2, va.GetInt32("InvalidInt32", 2, false));
        }
 public void GetInt32()
 {
     VariableAccessor va = new VariableAccessor(_testVariableSource);
     Assert.AreEqual((int)1, va.GetInt32("ValidInt32", 2));
     Assert.AreEqual((int)2, va.GetInt32("InvalidInt32", 2, false));
     try
     {
         va.GetInt32("InvalidInt32", 2, true);
         Assert.Fail();
     }
     catch { }
 }