public void TestDisposedFilename() { HttpFile file = new HttpFile("object", "object", "object"); file.Dispose(); #pragma warning disable 168 Assert.Throws(typeof (ObjectDisposedException), delegate { string tmp = file.Filename; }); #pragma warning restore 168 }
/// <summary> Test to make sure files gets deleted upon disposing </summary> public void TestFileDeletion() { string path = Environment.CurrentDirectory + "\\tmptest"; HttpFile file = new HttpFile("testFile", path, "nun"); File.WriteAllText(path, "test"); file.Dispose(); Assert.Equal(File.Exists(path), false); }
public void TestDisposedFilename() { HttpFile file = new HttpFile("object", "object", "object"); file.Dispose(); #pragma warning disable 168 Assert.Throws(typeof(ObjectDisposedException), delegate { string tmp = file.Filename; }); #pragma warning restore 168 }