static void Test_CheckUIElementsAfterLoad(FormSyncMain form)
        {
            var prevConfig = form.GetCurrentConfigFromUI();
            var config1    = SyncConfiguration.Deserialize(Testing.GetTestFile("test_cfg_01.xml"));

            form.SetCurrentConfigToUI(config1);
            Test_CheckUIElements(config1, form);
            var config2 = SyncConfiguration.Deserialize(Testing.GetTestFile("test_cfg_02.xml"));

            form.SetCurrentConfigToUI(config2);
            Test_CheckUIElements(config2, form);
            form.SetCurrentConfigToUI(prevConfig);
        }
        static void Test_SaveFromUIElements(FormSyncMain form)
        {
            var prevConfig = form.GetCurrentConfigFromUI();
            var config1    = SyncConfiguration.Deserialize(Testing.GetTestFile("test_cfg_01.xml"));

            form.SetCurrentConfigToUI(config1);
            var config2 = SyncConfiguration.Deserialize(Testing.GetTestFile("test_cfg_02.xml"));

            Test_SetUIElements(config2, form);
            var config2FromForm = form.GetCurrentConfigFromUI();

            File.Delete(Testing.GetTestTempFile("test_cfg_02_got.xml"));
            SyncConfiguration.Serialize(config2FromForm, Testing.GetTestTempFile("test_cfg_02_got.xml"));
            string sExpected = File.ReadAllText(Testing.GetTestFile("test_cfg_02.xml"));
            string sGot      = File.ReadAllText(Testing.GetTestTempFile("test_cfg_02_got.xml"));

            form.SetCurrentConfigToUI(prevConfig);
        }
        static void Test_SetUIElements(SyncConfiguration config, FormSyncMain form)
        {
            form.txtSrc.Text                 = config.m_src;
            form.txtDest.Text                = config.m_destination;
            form.txtExcludeDirs.Text         = config.m_excludeDirs;
            form.txtExcludeFiles.Text        = config.m_excludeFiles;
            form.txtCopyFlags.Text           = config.m_copyFlags;
            form.txtDirCopyFlags.Text        = config.m_directoryCopyFlags;
            form.txtIpg.Text                 = config.m_ipg;
            form.txtnRetries.Text            = config.m_nRetries;
            form.txtnWaitBetweenRetries.Text = config.m_waitBetweenRetries;
            form.txtnThreads.Text            = config.m_nThreads;
            form.txtCustom.Text              = config.m_custom;

            form.chkMirror.Checked           = config.m_mirror;
            form.chkCopySubdirs.Checked      = config.m_copySubDirsAndEmptySubdirs;
            form.chkSymlinkNotTarget.Checked = config.m_symlinkNotTarget;
            form.chkFatTimes.Checked         = config.m_fatTimes;
            form.chkCompensateDST.Checked    = config.m_compensateDst;
        }
        static void Test_CheckUIElements(SyncConfiguration config, FormSyncMain form)
        {
            Utils.AssertEq(config.m_src, form.txtSrc.Text);
            Utils.AssertEq(config.m_destination, form.txtDest.Text);
            Utils.AssertEq(config.m_excludeDirs, form.txtExcludeDirs.Text);
            Utils.AssertEq(config.m_excludeFiles, form.txtExcludeFiles.Text);
            Utils.AssertEq(config.m_copyFlags, form.txtCopyFlags.Text);
            Utils.AssertEq(config.m_directoryCopyFlags, form.txtDirCopyFlags.Text);
            Utils.AssertEq(config.m_ipg, form.txtIpg.Text);
            Utils.AssertEq(config.m_nRetries, form.txtnRetries.Text);
            Utils.AssertEq(config.m_waitBetweenRetries, form.txtnWaitBetweenRetries.Text);
            Utils.AssertEq(config.m_nThreads, form.txtnThreads.Text);
            Utils.AssertEq(config.m_custom, form.txtCustom.Text);

            Utils.AssertEq(config.m_mirror, form.chkMirror.Checked);
            Utils.AssertEq(config.m_copySubDirsAndEmptySubdirs, form.chkCopySubdirs.Checked);
            Utils.AssertEq(config.m_symlinkNotTarget, form.chkSymlinkNotTarget.Checked);
            Utils.AssertEq(config.m_fatTimes, form.chkFatTimes.Checked);
            Utils.AssertEq(config.m_compensateDst, form.chkCompensateDST.Checked);
        }