Renci.SshNet.Common.ASCIIEncoding.GetMaxByteCount C# (CSharp) Method

GetMaxByteCount() public method

Calculates the maximum number of bytes produced by encoding the specified number of characters.
is less than zero.
public GetMaxByteCount ( int charCount ) : int
charCount int The number of characters to encode.
return int
        public override int GetMaxByteCount(int charCount)
        {
            if (charCount < 0)
                throw new ArgumentOutOfRangeException("charCount", "Non-negative number required.");

            return charCount + 1;
        }

Usage Example

示例#1
0
 public void GetMaxByteCountTest()
 {
     ASCIIEncoding target = new ASCIIEncoding(); // TODO: Initialize to an appropriate value
     int charCount = 0; // TODO: Initialize to an appropriate value
     int expected = 0; // TODO: Initialize to an appropriate value
     int actual;
     actual = target.GetMaxByteCount(charCount);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }