示例#1
0
        public void AreStreamContentEqual()
        {
            string assemblyPath = Assembly.GetExecutingAssembly().Location;
            string path         = Path.GetDirectoryName(assemblyPath);
            string pathFile     = Path.Combine(path, "MbUnitFileAssert_Test.tmp");


            try
            {
                StreamWriter strWriter = new StreamWriter(pathFile);

                strWriter.WriteLine("Testing MbUnit");
                strWriter.Close();

                Stream str = new FileStream(pathFile, FileMode.Open);

                File.Copy(pathFile, pathFile + "TestCopy", true);
                Stream str2 = new FileStream(pathFile + "TestCopy", FileMode.Open);

                FileAssert.AreStreamContentEqual(str, str2);
            }
            finally
            {
                File.Delete(pathFile + "TestCopy");
            }
        }