private void SetUpMocks(string sourceFile, string destDir, string destFile, string backupFile, string template, string processedTemplate, IDictionary<string, string> properties, IList<string> tokensNotFound, bool destinationExists, bool backupExists, bool destDirExists, bool willWriteToDestination)
{
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(destFile)).Returns(destDir);
this.mockFSO.Setup(x => x.DirectoryExists(destDir)).Returns(destDirExists);
if (!destDirExists)
{
this.mockFSO.Setup(x => x.CreateDirectory(destDir));
}
if (willWriteToDestination)
{
this.mockFSO.Setup(x => x.WriteAllText(destFile, processedTemplate));
}
}