public void SqlCharsSetNull () { char [] b1 = new char [10]; SqlChars chars = new SqlChars (b1); Assert.AreEqual (chars.Length, 10, "#1 Should be same"); chars.SetNull (); try { Assert.AreEqual (chars.Length, 10, "#1 Should not be same"); Assert.Fail ("Should throw SqlNullValueException"); } catch (Exception ex) { Assert.AreEqual (typeof (SqlNullValueException), ex.GetType (), "Should throw SqlNullValueException"); } Assert.AreEqual (true, chars.IsNull, "#2 Should be same"); }
public void SqlCharsSetNull() { char[] b1 = new char[10]; SqlChars chars = new SqlChars(b1); Assert.Equal(chars.Length, 10); chars.SetNull(); try { Assert.Equal(chars.Length, 10); Assert.False(true); } catch (Exception ex) { Assert.Equal(typeof(SqlNullValueException), ex.GetType()); } Assert.Equal(true, chars.IsNull); }