public void NullUtils_GetInt32_Value_Success() { var reader = new StubDataReader(new StubResultSet("unit_test").AddRow(24)); reader.Read(); Assert.AreEqual(24, NullUtils.GetInt32(reader, "unit_test"), "GetInt32(value) did not return the expected value"); }
public void NullUtils_GetInt32_Null_Success() { var reader = new StubDataReader(new StubResultSet("unit_test").AddRow(DBNull.Value)); reader.Read(); Assert.AreEqual(default(int), NullUtils.GetInt32(reader, "unit_test"), "GetInt32(null) should have returned the default int value"); }