public static void TestInitialize(TestContext testContext) { _mockObjForExecuteUrl = new Mock <IGitCommandExecute>(); _mockObjForZipOperation = new Mock <IZip>(); _mockObjForSendOperation = new Mock <ISendInput>(); _mockObjCompareOperation = new Mock <ICompare>(); _mockObjForCleanUpOperation = new Mock <IDataRemove>(); _helper = new Helper(); _zip = new ZipGitRepo(); _dataExtract = new CsvDataExtractor(); _thresholdRecieve = new QualityThresholdListRecieve(); _dataRemove = new TemporaryDataRemover(); _sendInput = new SendProjectPathAsInput(); _testHelper = new TestHelper(); _recievedThresholdList = new List <string>() { "Error", "Warning", "Error", "Warning" }; _targetThresholdList = new List <string>() { "error: 3", "Warning: 3" }; }
public void PerformComparisonAndCleanUp(IThresholdRecieve inputRecieve, IDataExtract dataExtract, ICompare compare, IDataRemove dataRemove, string fileName, string zipPath, string outputPath) { var qualityThresholdList = inputRecieve.getThresholdList(fileName); var csvThresholdList = dataExtract.ExtractData(outputPath); compare.Compare(qualityThresholdList, csvThresholdList); Thread.Sleep(10000); dataRemove.Remove(Path.GetFullPath(Directory.GetCurrentDirectory()), zipPath, fileName); }
public void PerformExecute(IGitCommandExecute execute, IZip zip, ISendInput sendInput, IThresholdRecieve inputRecieve, IDataExtract dataExtract, ICompare compare, IDataRemove dataRemove) { Console.WriteLine("Enter repo to clone:"); var urlIn = Console.ReadLine(); var url = ExecuteUrl(execute, urlIn); Thread.Sleep(10000); Console.WriteLine("Zip operation undergoes"); Thread.Sleep(10000); Console.WriteLine("Sending zip to server"); Thread.Sleep(10000); var fileName = url.Split('/')[1].Split('.')[0]; var zipPath = PerformZipOperation(zip, sendInput, url, fileName); PerformSendOperation(sendInput, zipPath); PerformComparisonAndCleanUp(inputRecieve, dataExtract, compare, dataRemove, fileName, zipPath, _outputPath); }
public IGitCommandExecute InitExecute(out IZip zip, out ISendInput sendInput, out IDataRemove dataRemove, out IThresholdRecieve inputRecieve, out IDataExtract dataExtract, out ICompare compare) { IGitCommandExecute execute = new GitCloneExecute(); zip = new ZipGitRepo(); sendInput = new SendProjectPathAsInput(); dataRemove = new TemporaryDataRemover(); inputRecieve = new QualityThresholdListRecieve(); dataExtract = new CsvDataExtractor(); compare = new QualityThresholdEvaluator(); return(execute); }