public void PosTest2() { int expectedValue = 2; int actualValue; UnicodeEncoding uE = new UnicodeEncoding(); actualValue = uE.GetMaxCharCount(1); Assert.Equal(expectedValue, actualValue); }
public void NegTest1() { int actualValue; UnicodeEncoding uE = new UnicodeEncoding(); Assert.Throws<ArgumentOutOfRangeException>(() => { actualValue = uE.GetMaxCharCount(-1); }); }
public void PosTest3() { int byteCount = _generator.GetInt32(-55); int expectedValue = (byteCount + 1) / 2 + 1; int actualValue; UnicodeEncoding uE = new UnicodeEncoding(); actualValue = uE.GetMaxCharCount(byteCount); Assert.Equal(expectedValue, actualValue); }
static public int GetMaxCharCount(IntPtr l) { try { System.Text.UnicodeEncoding self = (System.Text.UnicodeEncoding)checkSelf(l); System.Int32 a1; checkType(l, 2, out a1); var ret = self.GetMaxCharCount(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
public void TestMaxCharCount() { UnicodeEncoding UnicodeEnc = new UnicodeEncoding (); #if NET_2_0 // where is this extra 1 coming from? Assert.AreEqual (26, UnicodeEnc.GetMaxCharCount(50), "UTF #1"); Assert.AreEqual (27, UnicodeEnc.GetMaxCharCount(51), "UTF #2"); #else Assert.AreEqual (25, UnicodeEnc.GetMaxCharCount(50), "UTF #1"); #endif }
public void TestMaxCharCount() { UnicodeEncoding UnicodeEnc = new UnicodeEncoding (); Assert.AreEqual (26, UnicodeEnc.GetMaxCharCount(50), "UTF #1"); Assert.AreEqual (27, UnicodeEnc.GetMaxCharCount(51), "UTF #2"); }
public void TestMaxCharCount() { UnicodeEncoding UnicodeEnc = new UnicodeEncoding (); Assertion.AssertEquals ("UTF #1", 25, UnicodeEnc.GetMaxCharCount(50)); }