Beispiel #1
0
        public void CreateTemporaryFileTest()
        {
            string extension = ".tmp";
            File   actual;

            actual = File.CreateTemporaryFile(extension);

            Assert.IsFalse(System.IO.File.Exists(actual.Path), "File should not exist");
            actual.Create();

            Assert.IsTrue(System.IO.File.Exists(actual.Path), "File should exist");
            string dir = Path.GetDirectoryName(actual.Path) + "\\";

            Assert.AreEqual(Path.GetTempPath(), dir, "Temp Directory different");

            actual.Delete();
            Assert.IsFalse(System.IO.File.Exists(actual.Path), "Temp File should not exist");
        }