Amido.PreProcessor.Cmd.Tests.TokenisationRunnerTests.SetUpMocks C# (CSharp) Метод

SetUpMocks() приватный Метод

private SetUpMocks ( string sourceFile, string destDir, string destFile, string backupFile, string template, string processedTemplate, string>.IDictionary properties, IList tokensNotFound, bool destinationExists, bool backupExists, bool destDirExists, bool willWriteToDestination ) : void
sourceFile string
destDir string
destFile string
backupFile string
template string
processedTemplate string
properties string>.IDictionary
tokensNotFound IList
destinationExists bool
backupExists bool
destDirExists bool
willWriteToDestination bool
Результат void
        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));
            }

        }