private int ExportSpecifiedDeductionValuesAndGetAvailableMaterialCount(List <Action> deductionSelectionCommandList)
        {
            var settingsDialog = HomeZone.GotoMainMenu().OpenSettingsDialog();
            var bendSettings   = settingsDialog.BendSettings;

            bendSettings.Goto();
            bendSettings.OpenDataManagerBend();

            DatamanagerBend.MainWindowExists.WaitFor(TestSettings.DatamanagerBendStartTimeout);
            DatamanagerBend.DeductionValues.Goto();
            DatamanagerBend.DeductionValues.ExportTBSCSV();
            foreach (var cmd in deductionSelectionCommandList)
            {
                cmd.Invoke();
            }

            IListBox listBox = Driver.Find <IProcess>(new ProcessPattern()
            {
                ProcessName = "DataManager"
            }).Find <IControl>(new WPFPattern()
            {
                ClrFullClassName = "Trumpf.TruTops.DataMigrationTool.Views.Bend_Factor_Explorer.TcBendFactorTbsExportDialog"
            }, 2).Find <IListBox>(new WPFPattern()
            {
                ClrFullClassName = "System.Windows.Controls.ListBox"
            }, 2);
            var selectedItemsCount = listBox.wSelected.Count();

            DatamanagerBend.DeductionValues.TBSExportDialog.Export();
            DatamanagerBend.Close();

            settingsDialog.Save();

            return(selectedItemsCount);
        }
        /// <summary>
        /// Import test deduction values from TestData
        /// </summary>
        private void ImportTestDeductionValues()
        {
            var materials = HomeZone.Materials;

            materials.ResultColumn.SearchText.Value = S_CUSTOM_MATERIAL_NAME;
            materials.ResultColumn.DoSearch();
            int count = materials.ResultColumn.Count;

            materials.ResultColumn.ClearSearch();
            if (count == 0)
            {
                materials.ResultColumn.SelectItem(S_MATERIAL_NAME_TO_DUPLICATE);
                materials.Toolbar.Duplicate();
                materials.Detail.Id.Value = S_CUSTOM_MATERIAL_NAME;
                materials.Toolbar.Save();

                var settingsDialog = HomeZone.GotoMainMenu().OpenSettingsDialog();
                var bendSettings   = settingsDialog.BendSettings;
                bendSettings.Goto();
                bendSettings.OpenDataManagerBend();

                string testDataPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), S_TESTDATA_SUB_PATH);
                Dictionary <string, string> baselineDictionary = Directory.GetFiles(testDataPath, S_ARVX_FILE_ENDING_FILTER).ToDictionary(item => Path.GetFileName(item), item => item);
                DatamanagerBend.MainWindowExists.WaitFor(TestSettings.DatamanagerBendStartTimeout);
                DatamanagerBend.Tools.Import(baselineDictionary.First().Value);
                DatamanagerBend.Close();

                settingsDialog.Save();
            }
        }
        /// <summary>
        /// Implementation of the open and close datamanager test
        /// </summary>
        private void DoOpenAndCloseDataManagerBendTest()
        {
            var settingsDialog = HomeZone.GotoMainMenu().OpenSettingsDialog();
            var bendSettings   = settingsDialog.BendSettings;

            bendSettings.Goto();

            Assert.IsTrue(bendSettings.IsVisible);

            bendSettings.OpenDataManagerBend();

            DatamanagerBend.MainWindowExists.WaitFor(TestSettings.DatamanagerBendStartTimeout);
            DatamanagerBend.Close();

            settingsDialog.Cancel();
        }