Example #1
0
        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"
            };
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
 public void PerformSendOperation(ISendInput sendInput, string zipPath)
 {
     sendInput.Send(zipPath);
 }
Example #5
0
 public string PerformZipOperation(IZip zip, ISendInput sendInput, string url, string fileName)
 {
     return(zip.Zip(fileName));
 }