Library/Library.Test/TestTempFiles.cs
C# | Copy Code |
---|---|
using(TempFile a = TempFile.FromExtension(".test")) { a.WriteAllText("a"); Assert.AreEqual("a", a.ReadAllText()); Assert.AreEqual(".test", Path.GetExtension(a.TempPath)); using (TempFile b = TempFile.FromCopy(a.TempPath)) { Assert.AreEqual("a", b.ReadAllText()); Assert.AreEqual(".test", Path.GetExtension(b.TempPath)); } } |
VB.NET | Copy Code |
---|---|
Using a As TempFile = TempFile.FromExtension(".test") a.WriteAllText("a") Assert.AreEqual("a", a.ReadAllText()) Assert.AreEqual(".test", Path.GetExtension(a.TempPath)) Using b As TempFile = TempFile.FromCopy(a.TempPath) Assert.AreEqual("a", b.ReadAllText()) Assert.AreEqual(".test", Path.GetExtension(b.TempPath)) End Using End Using |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
TempFile ClassTempFile Members
Used By
TestResXtoMc.TestEmptyResXToMc()TestResXtoMc.TestSimpleStringResXToMc()
TestResXtoMc.TestResXToMcWithCategoryFacilityAndSource()
TestResXtoMc.TestFormatResXToMc()
TestResXtoMc.TestFormatWithSuffixResXToMc()
Int32 ScriptRunner.Run(TextReader,String[])
ScriptRunner.Start(String[])