// //You can use the following additional attributes as you write your tests: // //Use ClassInitialize to run code before running the first test in the class //[ClassInitialize()] //public static void MyClassInitialize(TestContext testContext) //{ //} // //Use ClassCleanup to run code after all tests in a class have run //[ClassCleanup()] //public static void MyClassCleanup() //{ //} // //Use TestInitialize to run code before running each test //[TestInitialize()] //public void MyTestInitialize() //{ //} // //Use TestCleanup to run code after each test has run //[TestCleanup()] //public void MyTestCleanup() //{ //} // #endregion private void BaseTest(CLoadFilesOptions target) { Assert.IsNotNull(target); Assert.AreEqual(target.Directory, directory); Assert.AreEqual(target.FileExtensions.Count, file_extensions_count); Assert.IsFalse(target.MustWorkWithOneFile); }
/// <summary> /// /// </summary> /// <param name="LanguageID"></param> /// <param name="load_files_options"></param> public CSyntacticUnitsInfoProvider(LANGUAGES LanguageID, CLoadFilesOptions load_files_options) : base(load_files_options) { m_Extension = CAvailableExtentions.GetExtention(LanguageID); m_SynUnitsCollection = new CSyntacticUnitsCollection(); m_CountOfSyntacticUnits = 0; }
public void SetFileExtensionsTest() { CLoadFilesOptions target = CommotTest(); target.SetFileExtensions(file_extensions); Assert.AreEqual(target.FileExtensions.Count, file_extensions_count); Assert.AreEqual(target.FileExtensions[0], ".xxx"); }
public void SetFileEncodingTest() { CLoadFilesOptions target = CommotTest(); Encoding value = Encoding.GetEncoding(CODE_PAGE); target.SetFileEncoding(value); Assert.AreEqual(target.FileEncoding, files_encoding); }
public void SetDirectoryTest() { CLoadFilesOptions target = CommotTest(); target.SetDirectory(directory); Assert.AreEqual(target.Directory, directory); Assert.IsFalse(target.MustWorkWithOneFile); }
public void CLoadFilesOptionsConstructorTest3() { CLoadFilesOptions target = new CLoadFilesOptions(path_to_file); Assert.IsNotNull(target); Assert.IsTrue(target.MustWorkWithOneFile); Assert.AreEqual(target.PathToFile, path_to_file); }
public void CLoadFilesOptionsConstructorTest2() { CCodePreProcessingOptions Options = new CCodePreProcessingOptions(); CLoadFilesOptions target = new CLoadFilesOptions(directory, file_extensions, files_encoding, Options); BaseTestEx(target); Assert.AreEqual(target.PreProcessingOptions, Options); }
public void SetPreProcessingOptionsTest() { CLoadFilesOptions target = CommotTest(); CCodePreProcessingOptions value = new CCodePreProcessingOptions(); target.SetPreProcessingOptions(value); Assert.AreEqual(value, target.PreProcessingOptions); }
public void SetIsUseParallelExtensionsTest() { CLoadFilesOptions target = CommotTest(); bool value = !target.IsUseParallelExtensions; target.SetIsUseParallelExtensions(value); Assert.AreEqual(value, target.IsUseParallelExtensions); }
public void SetIsPreProcessingFileTest() { CLoadFilesOptions target = CommotTest(); Assert.IsFalse(target.IsPreProcessingFile); target.SetIsPreProcessingFile(true); Assert.IsTrue(target.IsPreProcessingFile); }
private CLoadFilesOptions CommotTest() { CLoadFilesOptions target = new CLoadFilesOptions(); Assert.IsNotNull(target); Assert.IsFalse(target.MustWorkWithOneFile); Assert.AreEqual(target.Directory, string.Empty); Assert.AreEqual(target.PathToFile, string.Empty); return(target); }
public void SetPathToFileTest() { CLoadFilesOptions target = CommotTest(); target.SetPathToFile(path_to_file); Assert.AreEqual(target.PathToFile, path_to_file); Assert.AreEqual(target.Directory, string.Empty); Assert.IsTrue(target.MustWorkWithOneFile); target.SetPathToFile(string.Empty); }
public void SetSkippingFoldersTest() { CLoadFilesOptions target = CommotTest(); Assert.AreEqual(target.SkippingFolders, string.Empty); string value = "rttt, dfsdf, sdfsdf"; target.SetSkippingFolders(value); Assert.AreEqual(target.SkippingFolders, value); }
private CSyntacticInfo calc(string testfile) { string filename = Path.GetFullPath(testfile); Assert.IsTrue(File.Exists(filename)); LANGUAGES lang = LANGUAGES.LANGUAGE_C_SHARP; CLoadFilesOptions load_files_options = new CLoadFilesOptions(filename); CSyntacticUnitsInfoProvider target = new CSyntacticUnitsInfoProvider(lang, load_files_options); return(target.Calculate()); }
//protected CBaseCloneSearchExecutor() // : this(CAvailableCloneSearchAlgorithms.GetAlgorithm(CloneSearchAlgoritms.HashBucketAlgorithm)) //{} public CBaseCloneSearchExecutor(CBaseCloneSearchStrategy search_algorithm, ICloneExtension ext) { m_ext = ext; m_ProcessedClonesCounter = 0; m_ReportingCounter = 0; m_MessageEventArgs = new MessageEventArgs(); m_LoadFilesOptions = new CLoadFilesOptions(); m_FilesList = new CModifiableSourceFilesList(m_ext); m_CloneSearchProvider = new CCloneSearchProvider(search_algorithm); InitBackgroundThread(); m_CloneSearchProvider.InitCloneSearchCallbacks(new EventHandler(ReportCloneSearchStart), new EventHandler(ReportCloneSearchProgress), new EventHandler(ReportCloneSearchEnd)); //m_FilesList.InitFilesListBuildingCallbacks(new EventHandler(ReportFilesListBuildingStart), null, new EventHandler(ReportFilesListBuildingEnd)); //m_FilesList.InitLoadFilesCallbacks(new EventHandler(ReportLoadFilesStart), new EventHandler(ReportLoadFilesProgress), null); }
private void PrepareLoadFilesOptions() { ICloneExtension Ext = ChooseLangComboBox.SelectedItem as ICloneExtension; CICloneEncodingInfo EncodeInfo = CodeEncodingComboBox.SelectedItem as CICloneEncodingInfo; CLoadFilesOptions LoadFilesOptions = new CLoadFilesOptions(CodeLocationTextBox.Text, ChoosenFilesExtensionsTextBox.Text, EncodeInfo.GetEncodingInfo().GetEncoding(), new CCodePreProcessingOptions(Ext.GetCommentSymbols())); LoadFilesOptions.SetSkippingFolders(Properties.Settings.Default.CSWSkippingFolders); LoadFilesOptions.SetIsUseParallelExtensions(Properties.Settings.Default.CSWIsUseParallelExtensions); m_CloneSearchExecutor.SetLoadFilesOptions(LoadFilesOptions); if (AutomaticKminCalculationCheckBox.Checked) { CCodeSizeDetector Counter = new CCodeSizeDetector(Ext.LanguageID(), new CLoadFilesOptions(CodeLocationTextBox.Text, ChoosenFilesExtensionsTextBox.Text)); //Counter.LoadFilesProgress += new EventHandler(ReportProgress); CSyntacticInfo info = Counter.Calculate(); CCodeFragment.SetKmin(info.Kmin); } else { CCodeFragment.SetKmin((long)KminValue.Value); } m_CloneSearchExecutor.Extension = Ext; }
/// <summary> /// Конструктор по умолчанию /// </summary> public CCodeSizeDetector(LANGUAGES LanguageID, CLoadFilesOptions load_files_options) : base(LanguageID, load_files_options) { ClearCounters(); }
public void SetLoadFilesOptions(CLoadFilesOptions LoadFilesOptions) { m_LoadFilesOptions = LoadFilesOptions; m_FilesList.SetLoadFilesOptions(LoadFilesOptions); }
public void CLoadFilesOptionsConstructorTest() { CLoadFilesOptions target = new CLoadFilesOptions(directory, file_extensions); BaseTest(target); }
private void BaseTestEx(CLoadFilesOptions target) { BaseTest(target); Assert.AreEqual(target.FileEncoding, files_encoding); }
public void CLoadFilesOptionsConstructorTest4() { CLoadFilesOptions target = CommotTest(); }
public void CLoadFilesOptionsConstructorTest1() { CLoadFilesOptions target = new CLoadFilesOptions(directory, file_extensions, files_encoding); BaseTestEx(target); }