Md5SumByProcess() public static method

public static Md5SumByProcess ( string file ) : string
file string
return string
コード例 #1
0
        public void CanReadTheWholeFile()
        {
            var stream = new SeekableNetworkStream(Constants.TWENTY_MEG_FILE);

            byte[] source = new byte[stream.Length];
            stream.Read(source, 0, (int)stream.Length);
            string tempFile = Path.GetTempFileName();

            try
            {
                File.WriteAllBytes(tempFile, source);
                string checkSum = DownloadTests.Md5SumByProcess(tempFile);
                Assert.True(checkSum == Constants.TWENTY_CHECKSUM);
            }
            finally
            {
                File.Delete(tempFile);
            }
        }