public void TestProcessSingleTemplate_UsingConventionForDestinationFilePath()
{
sourceFile = @"c:\aDir\someFile.xml.template";
destFile = null;
var derivedDestimationFile = @"c:\aDir\someFile.xml";
destDir = @"c:\aDir\";
backupFile = @"c:\aDir\someOtherFile.xml.bak";
const string template = "some tokenised <%token1%> text.";
const string processedTemplate = "some tokenised value1 text.";
var properties = new Dictionary<string, string>();
properties.Add("token1", "value1");
IList<string> tokensNotFound = new List<string>();
this.mockTokeniser.Setup(x => x.TryReplace(sourceFile, properties, out tokensNotFound)).Returns(sourceFile);
this.mockTokeniser.Setup(x => x.TryReplace(destFile, properties, out tokensNotFound)).Returns(destFile);
this.mockFSO.Setup(x => x.FileExists(sourceFile)).Returns(true);
this.mockFSO.Setup(x => x.ReadAllText(sourceFile)).Returns(template);
this.mockTokeniser.Setup(x => x.TryReplace(template, properties, out tokensNotFound)).Returns(processedTemplate);
this.mockFSO.Setup(x => x.GetDirectoryFullPath(derivedDestimationFile)).Returns(destDir);
this.mockFSO.Setup(x => x.DirectoryExists(destDir)).Returns(true);
this.mockFSO.Setup(x => x.WriteAllText(derivedDestimationFile, processedTemplate));
this.tokenisationRunner.ProcessSingleTemplate(properties, sourceFile, destFile);
}