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 |
Résultat | int |
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 { } }