Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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");
        }
Beispiel #4
0
 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);
 }
Beispiel #5
0
        public void LieferDatumTest()
        {
            var FromDateExpected = DateTime.Today.ToString("yyyy-MM-dd");// "2014-03-19";

            InvVm.LoadTemplateCommand.Execute(Common.InvTemplate);
            InvVm.PrintDump();
            //Assert.IsInstanceOf<PeriodType>(Cmn.Invoice.Delivery.Item, "Delivery Item not null");
            Assert.AreEqual(DateTime.Parse(FromDateExpected), InvVm.VmLieferDatum, "Check Fromdate in InvoiceView");

            // Lieferdatum
            InvVm.SaveTemplateCommand.Execute(DeliveryDateInvoice);
            XDocument xdoc    = XDocument.Load(DeliveryDateInvoice);
            var       delDate = xdoc.XPathSelectElement(DeliveryDateXPath, Nspc);

            Assert.IsNotNull(delDate, "Deliverydate nach Savetemplate");
            Assert.AreEqual(FromDateExpected, delDate.Value, "Check Deliverydate");
            var fromDate = xdoc.XPathSelectElement(DeliveryFromDateXPath, Nspc);

            Assert.IsNull(fromDate, "Kein Fromdate im XML");
            var toDate = xdoc.XPathSelectElement(DeliveryToDateXPath, Nspc);

            Assert.IsNull(fromDate, "Kein Todate im XML");
        }