Exemplo n.º 1
0
        public void GetVersionsWithSaveSupportedTest()
        {
            var supportedLIst = InvoiceFactory.GetVersionsWithSaveSupported();

            Assert.IsNotNull(supportedLIst);
            Assert.IsFalse(supportedLIst.Contains("V4P0"));
        }
Exemplo n.º 2
0
        public void LoadSaveInvoiceTest(FileNameTestCase testCase)
        {
            Console.WriteLine($"{testCase.Version}->{testCase.InputFile}");
            var ebiList = InvoiceFactory.GetVersionsWithSaveSupported();
            var dlgMoq  = new Mock <IDialogService>();

            dlgMoq.Setup(dlg => dlg.ShowMessageBox(It.IsAny <string>(),
                                                   It.IsAny <string>(),
                                                   It.Is <MessageBoxButtons>(mb => mb == MessageBoxButtons.YesNo),
                                                   It.IsAny <MessageBoxIcon>())).Returns(DialogResult.OK);

            string iFn   = testCase.InputFile;
            string oFn   = testCase.OutputFile;
            var    invVM = Cmn.UContainer.Resolve <InvoiceViewModel>(new ResolverOverride[] {
                new ParameterOverride("invoice", Cmn.Invoice),
                new ParameterOverride("dialog", dlgMoq.Object)
            });

            invVM.LoadTemplateCommand.Execute(iFn);
            PlugInSettings.Default.EbInterfaceVersionString = testCase.Version;
            string oFnTagged = Path.GetFileNameWithoutExtension(oFn);

            invVM.SaveEbinterfaceCommand.Execute(oFn);
            if (!invVM.Results.IsValid)
            {
                foreach (var item in invVM.Results)
                {
                    Console.WriteLine(item.Message);
                }
            }
            Assert.IsTrue(File.Exists(oFn), "Outputfile missing - " + testCase.Version);
        }
Exemplo n.º 3
0
        public FrmSelectVersion()
        {
            InitializeComponent();
            this.FileDlgType          = Win32Types.FileDialogType.SaveFileDlg;
            this.FileDlgStartLocation = AddonWindowLocation.Bottom;
            List <string> ebiLIst = InvoiceFactory.GetVersionsWithSaveSupported().OrderByDescending(p => p).ToList();

            comboBox1.DataSource = ebiLIst;
            // comboBox1.SelectedItem = SelectedVersion.ToString();
            //comboBox1.SelectedText = SelectedVersion.ToString();
            //  this.comboBox2.DataBindings.Add(new System.Windows.Forms.Binding("SelectedItem", this.bindingSourceReStellerSetting, "SelectedVersion", true));
        }
Exemplo n.º 4
0
        public static IEnumerable <FileNameTestCase> FileNameTestCases(string appendix, int testCaseNr, string version2Select)
        {
            List <string> allFiles = new List <string>()
            {
                "V4p0-Testrechnung",
                "V4p1-Testrechnung",
                "V4p2-Testrechnung",
                "V4p3-Testrechnung",
                "V5p0-Testrechnung"
            };
            List <string> files = allFiles;

            if (testCaseNr != -1)
            {
                files = new List <string>()
                {
                    allFiles[testCaseNr]
                };
            }
            string selectedVersion = version2Select;

            foreach (string version in InvoiceFactory.GetVersionsWithSaveSupported())
            {
                if (string.IsNullOrEmpty(selectedVersion) || version == selectedVersion)
                {
                    foreach (string file in files)
                    {
                        var dir = Path.GetDirectoryName(typeof(CommonSetUpClass).Assembly.Location);

                        var outputFile = Path.Combine(dir, "Daten", "Output", file + $"-savedAs-{version}-{appendix}.xml");
                        if (!Directory.Exists(Path.GetDirectoryName(outputFile)))
                        {
                            Directory.CreateDirectory(Path.GetDirectoryName(outputFile));
                        }
                        yield return(new FileNameTestCase()
                        {
                            InputFile = Path.Combine("Daten", file + ".xml"),
                            OutputFile = outputFile,
                            Version = version
                        });
                    }
                }
            }
        }
Exemplo n.º 5
0
        public BillerSettingsViewModel(IUnityContainer uc, IDialogService dialog
                                       )
        {
            _uc           = uc;
            _dlg          = dialog;
            _countryCodes = ebIModels.Models.CountryCodes.GetCountryCodeList();
            Results       = new ValidationResults();
            var cList = _uc.Resolve <CurrencyListViewModels>();

            //cList.GetList(Enum.GetNames(typeof(CurrencyType)).ToList());
            cList.GetList(new List <string>()
            {
                ModelConstants.CurrencyCodeFixed.ToString()
            });
            _currencyList = new BindingList <CurrencyListViewModel>(cList.DropDownList);
            string defCurr = PlugInSettings.Default.Currency;

            _currSelected = _currencyList.FirstOrDefault(p => p.Code == defCurr);
            _ebIVersions  = InvoiceFactory.GetVersionsWithSaveSupported();
            FillFromSettings();
        }