public void RabattBerechnungTestOk() { DetailsViewModel dView = Cmn.UContainer.Resolve <DetailsViewModel>(new ParameterOverrides() { { "bestPosRequired", false }, { "currentRuleSet", InvVm.CurrentSelectedValidation } }); dView.ArtikelNr = "1001"; dView.Bezeichnung = "Mister Blister"; dView.Menge = new decimal(10.0005); dView.EinzelPreis = new decimal(5.00); dView.VatItem = PlugInSettings.Default.MwStDefaultValue; dView.Einheit = "STK"; dView.Rabatt = 10; dView.BestellBezug = "22"; dView.SaveCommand.Execute(null); Cmn.ListResults(dView.Results); Assert.IsTrue(dView.Results.IsValid); DetailsViewModels dModels = Cmn.UContainer.Resolve <DetailsViewModels>(new ParameterOverrides() { { "bestPosRequired", false }, { "currentRuleSet", InvVm.CurrentSelectedValidation } }); dModels.DetailsViewList.Add(dView); InvVm.DetailsView = dModels.DetailsViewList; InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.IsTrue(InvVm.Results.IsValid); InvVm.SaveEbinterfaceCommand.Execute(@"Daten\RabattSaved.xml"); }
public void RelatedDocValidTestOk() { InvVm.VmDocType = DocumentTypeType.CreditMemo.ToString(); SaveCancelledDoc(); InvVm.IsInvoiceValid(); Assert.AreEqual(true, InvVm.Results.IsValid); }
public void RelatedDocInvalidRelDocTypeTestOk() { InvVm.VmDocType = DocumentTypeType.CreditMemo.ToString(); SetRelatedDocument(RelatedDocumentViewModel.RefType.Storno, DocumentTypeType.CreditMemo); InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.AreEqual(false, InvVm.Results.IsValid); }
public void RelatedDocInvalidInvoiceDocTypeTestOk() { InvVm.VmDocType = DocumentTypeType.FinalSettlement.ToString(); SetRelatedDocument(RelatedDocumentViewModel.RefType.Storno, DocumentTypeType.InvoiceForAdvancePayment); InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.AreEqual(false, InvVm.Results.IsValid); }
public void KontoLeerNotOkTests() { InitializeKontoTests(); InvVm.CurrentSelectedValidation = InvoiceSubtypes.ValidationRuleSet.Government; InvVm.VmDocType = DocumentTypeType.Invoice.ToString(); InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.IsFalse(InvVm.Results.IsValid); }
public void PlzEmptyTest() { InvVm.VmBillerPlz = ""; bool result = InvVm.IsInvoiceValid(); foreach (ValidationResult res in InvVm.Results) { Console.WriteLine(string.Format("{0}: {1}", res.Key, res.Message)); } Assert.AreEqual(false, result); }
public void StornoGutschriftOkTest() { InvVm.VmDocType = "CancelCreditMemo"; InvVm.RelatedDoc = Cmn.UContainer.Resolve <RelatedDocumentViewModel>(); InvVm.RelatedDoc.RefTypeSelected = RelatedDocumentViewModel.RefType.Storno; InvVm.RelatedDoc.RefSelectedDocType = "CreditMemo"; InvVm.RelatedDoc.RefInvNumber = "123123"; InvVm.RelatedDoc.RefInvDate = new DateTime(2013, 12, 13); InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.AreEqual(true, InvVm.Results.IsValid); }
public void StornoRechnungVerweisNotOkTest() { InvVm.VmDocType = "CancelInvoice"; InvVm.RelatedDoc = Cmn.UContainer.Resolve <RelatedDocumentViewModel>(); InvVm.RelatedDoc.RefTypeSelected = RelatedDocumentViewModel.RefType.Verweis; InvVm.RelatedDoc.RefSelectedDocType = "Invoice"; InvVm.RelatedDoc.RefInvNumber = "123123"; InvVm.RelatedDoc.RefInvDate = new DateTime(2013, 12, 13); InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.AreEqual(false, InvVm.Results.IsValid); }
public void FaelligVorRechnungsDatumTest() { InvVm.CurrentSelectedValidation = InvoiceSubtypes.ValidationRuleSet.Industries; InvVm.VmInvDate = DateTime.Today; InvVm.VmInvDueDate = DateTime.Today.AddDays(-1); bool result = InvVm.IsInvoiceValid(); Assert.AreEqual(false, result); InvVm.CurrentSelectedValidation = InvoiceSubtypes.ValidationRuleSet.Government; result = InvVm.IsInvoiceValid(); Assert.AreEqual(false, result); }
public void EmptyInvoiceNumberTest() { InvVm.CurrentSelectedValidation = InvoiceSubtypes.ValidationRuleSet.Industries; InvVm.VmInvNr = ""; bool result = InvVm.IsInvoiceValid(); Assert.AreEqual(false, result); InvVm.CurrentSelectedValidation = InvoiceSubtypes.ValidationRuleSet.Government; InvVm.VmInvNr = ""; result = InvVm.IsInvoiceValid(); Assert.AreEqual(false, result); }
public void SaveAndLoadEmptyCommentRelatedDocTestOk() { SaveRelatedDoc("REL11111", new DateTime(2013, 11, 12), "", DocumentTypeType.InvoiceForPartialDelivery); XDocument xDoc = XDocument.Load(SaveTempRelated); XElement xel = GetElement(xDoc, "RelatedDocument"); Assert.IsNotNull(xel, "Related Doc exists in XML"); // Assert.AreNotEqual(0,xel.Count); InvVm.LoadTemplateCommand.Execute(SaveTempRelated); InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.IsTrue(InvVm.Results.IsValid, "Invoice is valid"); }
public void KontoLeerStornoOkTests() { InitializeKontoTests(); InvVm.CurrentSelectedValidation = InvoiceSubtypes.ValidationRuleSet.Government; InvVm.VmDocType = DocumentTypeType.CreditMemo.ToString(); InvVm.RelatedDoc = Cmn.UContainer.Resolve <RelatedDocumentViewModel>(); InvVm.RelatedDoc.RefSelectedDocType = DocumentTypeType.Invoice.ToString(); InvVm.RelatedDoc.RefInvDate = new DateTime(2013, 12, 15); InvVm.RelatedDoc.RefInvNumber = "1234"; InvVm.RelatedDoc.RefTypeSelected = RelatedDocumentViewModel.RefType.Storno; InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.IsTrue(InvVm.Results.IsValid); }