System.Net.Tests.WebUtilityTests.UrlEncodeToBytes_NoEncodingNeeded_ReturnsNewClonedArray C# (CSharp) Method

UrlEncodeToBytes_NoEncodingNeeded_ReturnsNewClonedArray() private method

        public static void UrlEncodeToBytes_NoEncodingNeeded_ReturnsNewClonedArray()
        {
            // We have to make sure it always returns a new array, to
            // prevent problems where the input array is changed if
            // the output one is modified.

            byte[] input = Encoding.UTF8.GetBytes("Dont.Need.Encoding");
            byte[] output = WebUtility.UrlEncodeToBytes(input, 0, input.Length);
            Assert.NotSame(input, output);
        }