GetMaxByteCount() public method

public GetMaxByteCount ( int charCount ) : int
charCount int
return int
 private void DoNegAOORTest(ASCIIEncoding ascii, int charCount)
 {
     Assert.Throws<ArgumentOutOfRangeException>(() =>
     {
         ascii.GetMaxByteCount(charCount);
     });
 }
        private void DoPosTest(ASCIIEncoding ascii, int charCount, int expectedValue)
        {
            int actualValue;

            ascii = new ASCIIEncoding();
            actualValue = ascii.GetMaxByteCount(charCount);
            Assert.Equal(expectedValue, actualValue);
        }
Ejemplo n.º 3
0
 static public int GetMaxByteCount(IntPtr l)
 {
     try {
         System.Text.ASCIIEncoding self = (System.Text.ASCIIEncoding)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         var ret = self.GetMaxByteCount(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }