FluentFs.Support.Tokenization.TokenReplacer.To C# (CSharp) Method

To() public method

Outputs the token replaced to a file
Occurs if the file already exists
public To ( string destination ) : void
destination string the destination path
return void
        public void To(string destination)
        {
            if (_fileSystemWrapper.FileExists(destination))
                throw new IOException("File already exists. Delete it first");
            _fileSystemWrapper.WriteAllText(destination, Input);
        }

Usage Example

示例#1
0
 public void To_ShouldFailIfFileExists()
 {
     string destination = "c:\\temp";
     var fs = MockRepository.GenerateStub<IFileSystemWrapper>();
     fs.Stub(x => x.FileExists(destination)).Return(true);
     var replacer = new TokenReplacer(fs, "garbage");
     replacer.To(destination);
 }
All Usage Examples Of FluentFs.Support.Tokenization.TokenReplacer::To