public void Given_addressOftemplateFile_and_TargetFile_extensionList_when_GenerateTemplate_then_targetFileShouldGenerated()
 {
     var fileTemplate = new FileTemplate();
      var excludeExtension = new List<string> { "txt", "temp" };
      var hashtable = new Hashtable { { "extention", excludeExtension } };
     string addressOftemplateFile = "../../src/TargetFileTemplate.txt";
     fileTemplate.GenerateTemplate(addressOftemplateFile, "fakeAddressOfTargetFile.targets", hashtable);
     Assert.True(File.Exists("fakeAddressOfTargetFile.targets"));
 }
        public void Given_addressOftemplateFile_and_TargetFile_extensionList_when_GenerateTemplate_then_targetFileShouldGenerated()
        {
            var fileTemplate     = new FileTemplate();
            var excludeExtension = new List <string> {
                "txt", "temp"
            };
            var hashtable = new Hashtable {
                { "extention", excludeExtension }
            };
            string addressOftemplateFile = "../../src/TargetFileTemplate.txt";

            fileTemplate.GenerateTemplate(addressOftemplateFile, "fakeAddressOfTargetFile.targets", hashtable);
            Assert.True(File.Exists("fakeAddressOfTargetFile.targets"));
        }
        public void Given_addressOftemplateFile_and_TargetFile_extensionList_when_GenerateTemplate_then_targetFileShouldHaveExcludeListLine()
        {
            var fileTemplate = new FileTemplate();
            var excludeExtension = new List<string> { "txt", "temp" };
            var hashtable = new Hashtable { { "extention", excludeExtension } };
            string addressOftemplateFile = "../../src/TargetFileTemplate.txt";
            fileTemplate.GenerateTemplate(addressOftemplateFile, "fakeAddressOfTargetFile.targets", hashtable);
            var streamReader = new StreamReader("fakeAddressOfTargetFile.targets");
            string targetfilecontent = streamReader.ReadToEnd();
            streamReader.Close();

            string expectedContent = "TempTargetPackageFolderForGeneratingTargetFile/**/*.txt;TempTargetPackageFolderForGeneratingTargetFile/**/*.temp;";
            Assert.IsTrue(targetfilecontent.Contains(expectedContent));
        }
        public void Given_addressOftemplateFile_and_TargetFile_extensionList_when_GenerateTemplate_then_targetFileShouldHaveExcludeListLine()
        {
            var fileTemplate     = new FileTemplate();
            var excludeExtension = new List <string> {
                "txt", "temp"
            };
            var hashtable = new Hashtable {
                { "extention", excludeExtension }
            };
            string addressOftemplateFile = "../../src/TargetFileTemplate.txt";

            fileTemplate.GenerateTemplate(addressOftemplateFile, "fakeAddressOfTargetFile.targets", hashtable);
            var    streamReader      = new StreamReader("fakeAddressOfTargetFile.targets");
            string targetfilecontent = streamReader.ReadToEnd();

            streamReader.Close();

            string expectedContent = "TempTargetPackageFolderForGeneratingTargetFile/**/*.txt;TempTargetPackageFolderForGeneratingTargetFile/**/*.temp;";

            Assert.IsTrue(targetfilecontent.Contains(expectedContent));
        }
        private void GenerateTargetFile_Click(object sender, EventArgs e)
        {
            InitialiseAddresses();
            var tempTargetPackage = new TempTargetPackage();

            tempTargetPackage.MoveSelectedFilesToTargetProject(_addressOfSourceFile, _addressOfTargetPackage);

            var fileTemplate = new FileTemplate();

            RemoveEmptyElement();

            var hashtable = new Hashtable
            {
                { "extention", TargetFileDTO.excludeExtensions },
                { "startWith", TargetFileDTO.excludeStartWith },
                { "endWith", TargetFileDTO.excludeEndWith }
            };

            fileTemplate.GenerateTemplate(_addressOftemplateFile, _addressOfTargetFile, hashtable);
            Close();

            Process.Start("explorer.exe", TargetFileDTO.projectAddress);
        }
        private void GenerateTargetFile_Click(object sender, EventArgs e)
        {
            InitialiseAddresses();
               var tempTargetPackage = new TempTargetPackage();
               tempTargetPackage.MoveSelectedFilesToTargetProject(_addressOfSourceFile, _addressOfTargetPackage);

               var fileTemplate = new FileTemplate();
               RemoveEmptyElement();

               var hashtable = new Hashtable
                               {
                                   {"extention", TargetFileDTO.excludeExtensions},
                                   {"startWith", TargetFileDTO.excludeStartWith},
                                   {"endWith", TargetFileDTO.excludeEndWith}
                               };

               fileTemplate.GenerateTemplate(_addressOftemplateFile, _addressOfTargetFile, hashtable);
               Close();

               Process.Start("explorer.exe", TargetFileDTO.projectAddress);
        }