public void DeleteAllTemporaryFiles()
 {
     TemporaryFileManager.DeleteAllTemporaryFiles();
     _temporaryFileManager.CreateTemporaryFile();
     _temporaryFileManager.CreateTemporaryFile();
     Assertion.AssertEquals(2, TemporaryFileManager.GetExistingTemporaryFilenames().Length);
     TemporaryFileManager.DeleteAllTemporaryFiles();
     Assertion.AssertEquals(0, TemporaryFileManager.GetExistingTemporaryFilenames().Length);
 }
        public void GetExistingTemporaryFilenames()
        {
            TemporaryFileManager.DeleteAllTemporaryFiles();
            var filename1 = _temporaryFileManager.CreateTemporaryFile();
            var filename2 = _temporaryFileManager.CreateTemporaryFile();
            var filenames = TemporaryFileManager.GetExistingTemporaryFilenames();

            Assertion.AssertEquals("number of temp files", 2, filenames.Length);
            Assertion.Assert(filename1 != filename2);
            Assertion.Assert(filename1 == filenames[0] || filename1 == filenames[1]);
            Assertion.Assert(filename2 == filenames[0] || filename2 == filenames[1]);
        }
Exemple #3
0
        public void GetExistingTemporaryFilenames()
        {
            TemporaryFileManager.DeleteAllTemporaryFiles();
            var filename1 = TemporaryFileManager.CreateTemporaryFile();
            var filename2 = TemporaryFileManager.CreateTemporaryFile();
            var filenames = TemporaryFileManager.GetExistingTemporaryFilenames();

            Assert.AreEqual(2, filenames.Length, "number of temp files");
            Assert.IsTrue(filename1 != filename2);
            Assert.IsTrue(filename1 == filenames[0] || filename1 == filenames[1]);
            Assert.IsTrue(filename2 == filenames[0] || filename2 == filenames[1]);
        }