| Visual Basic (Declaration) | |
|---|---|
Public Class ReplaceFile Inherits TempFile Implements CSharpTest.Net.Interfaces.ITransactable | |
| C# | |
|---|---|
public class ReplaceFile : TempFile, CSharpTest.Net.Interfaces.ITransactable | |
Library/Library.Test/TestReplaceFile.cs
| C# | Copy Code |
|---|---|
string testdata = Guid.NewGuid().ToString(); using (TempFile replace = new TempFile()) using (ReplaceFile temp = new ReplaceFile(replace.TempPath)) { temp.WriteAllText(testdata); Assert.IsTrue(temp.Exists); temp.Rollback(); Assert.IsFalse(temp.Exists); } | |
| VB.NET | Copy Code |
|---|---|
Dim testdata As String = Guid.NewGuid().ToString() Using replace As New TempFile() Using temp As New ReplaceFile(replace.TempPath) temp.WriteAllText(testdata) Assert.IsTrue(temp.Exists) temp.Rollback() Assert.IsFalse(temp.Exists) End Using End Using | |
System.Object
CSharpTest.Net.IO.TempFile
CSharpTest.Net.IO.ReplaceFile
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7