Exemple #1
0
        public void CantDelete()
        {
            FwTempFile orange = new FwTempFile();

            orange.Writer.Write(kcontent);
            string       path   = orange.CloseAndGetPath();
            StreamReader reader = File.OpenText(path);

            orange.Dispose();
        }
Exemple #2
0
		public void Detach()
		{
			FwTempFile orange = new FwTempFile();
			orange.Writer.Write(kcontent);
			string path = orange.CloseAndGetPath();
			StreamReader reader = File.OpenText(path);

			orange.Detach();
			// This will close the writer.
			orange.Dispose();

			reader.Close();
			File.Delete(path);
		}
Exemple #3
0
        public void Detach()
        {
            FwTempFile orange = new FwTempFile();

            orange.Writer.Write(kcontent);
            string       path   = orange.CloseAndGetPath();
            StreamReader reader = File.OpenText(path);

            orange.Detach();
            // This will close the writer.
            orange.Dispose();

            reader.Close();
            File.Delete(path);
        }
Exemple #4
0
		/// <summary></summary>
		protected void CheckAndDispose(FwTempFile orange)
		{
			string tempPath = orange.CloseAndGetPath();
			StreamReader reader = null;
			try
			{
				reader = File.OpenText(tempPath);
				string s = reader.ReadToEnd();
				Assert.AreEqual(kcontent, s, "Contents of temp file did not match what I wrote to it.");
			}
			finally
			{
				if (reader != null)
					reader.Close();
				orange.Dispose();
			}
			Assert.IsFalse(File.Exists(tempPath), "Temp file was not deleted.");
		}
Exemple #5
0
        /// <summary></summary>
        protected void CheckAndDispose(FwTempFile orange)
        {
            string       tempPath = orange.CloseAndGetPath();
            StreamReader reader   = null;

            try
            {
                reader = File.OpenText(tempPath);
                string s = reader.ReadToEnd();
                Assert.AreEqual(kcontent, s, "Contents of temp file did not match what I wrote to it.");
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                orange.Dispose();
            }
            Assert.IsFalse(File.Exists(tempPath), "Temp file was not deleted.");
        }
Exemple #6
0
		public void CantDelete()
		{
			FwTempFile orange = new FwTempFile();
			orange.Writer.Write(kcontent);
			string path = orange.CloseAndGetPath();
			StreamReader reader = File.OpenText(path);
			orange.Dispose();
		}