コード例 #1
0
        public void RelatedDocumentViewModelKeinSelectedTest()
        {
            _rel = UContainer.Resolve <RelatedDocumentViewModel>();
            bool res = _rel.IsValid();

            Assert.AreEqual(true, res);
        }
コード例 #2
0
        public void BicIbanOkTests()
        {
            var bsVm = UContainer.Resolve <BillerSettingsViewModel>();

            bsVm.Name    = "Tester";
            bsVm.Strasse = "Verkäuferstrasse";
            bsVm.Ort     = "Testort";
            bsVm.Plz     = "4711";
            bsVm.VatId   = PlugInSettings.VatIdDefaultMitVstBerechtigung;
            bool bsRc = bsVm.IsValid();

            Assert.IsTrue(bsRc, "IsValid nach Basis-Setup");
            bsVm.Bic  = "VBWIATW1";
            bsVm.Iban = "AT611904300234573201";
            bsRc      = bsVm.IsValid();
            ListResults(bsVm.Results);
            Assert.IsTrue(bsRc, "IsValid nach BIC und IBAN");
            bsVm.Bic = "";
            bsRc     = bsVm.IsValid();
            ListResults(bsVm.Results);
            Assert.IsTrue(bsRc, "IsValid nach BIC ist leer");
            bsVm.Bic  = "VBWIATW1";
            bsVm.Iban = "";
            bsRc      = bsVm.IsValid();
            ListResults(bsVm.Results);
            Assert.IsTrue(bsRc, "IsValid nach IBAN ist leer");
        }
コード例 #3
0
        public void RelatedDocumentViewModelVerweisNoDateOkTest()
        {
            _rel = UContainer.Resolve <RelatedDocumentViewModel>();
            _rel.RefTypeSelected = RelatedDocumentViewModel.RefType.Verweis;
            _rel.RefInvNumber    = "123456";
            bool res = _rel.IsValid();

            Assert.AreEqual(true, res);
        }
コード例 #4
0
        public void StartProcessServiceWindowTestOk()
        {
            var sProc = UContainer.Resolve <IStartProcessDienst>();

            Assert.IsNotNull(sProc);
            sProc.ProcessFinishedEvent += OnStartProcessDienstProcessFinished;
            _waitEvent = new ManualResetEvent(false);
            sProc.Run(WindowExeFileName, arg, @"C:\TFS\ebInterface\Codeplex\Dvt4p1\eRechnung\ebIServicesTests\bin\Debug\Daten\", true);
            _waitEvent.WaitOne(2 * 1000); // Nötig, damit der Consolen-Output im Testergebnis erscheint
        }
コード例 #5
0
        public void RelatedDocumentViewModelVerweisCommentNotOkTest()
        {
            _rel = UContainer.Resolve <RelatedDocumentViewModel>();
            _rel.RefTypeSelected = RelatedDocumentViewModel.RefType.Verweis;
            _rel.RefInvNumber    = "123456";
            _rel.RefComment      = ">".PadRight(300, '.');
            bool res = _rel.IsValid();

            ListResults(_rel.Results);
            Assert.AreEqual(false, res);
        }
コード例 #6
0
        public void RelatedDocumentViewModelStornoOkTest()
        {
            _rel = UContainer.Resolve <RelatedDocumentViewModel>();
            _rel.RefTypeSelected = RelatedDocumentViewModel.RefType.Storno;
            _rel.RefInvNumber    = "123456";
            _rel.RefInvDate      = DateTime.Today;
            bool res = _rel.IsValid();

            ListResults(_rel.Results);
            Assert.AreEqual(true, res);
        }
コード例 #7
0
        public void SaveSettingsTtestOk()
        {
            UContainer.RegisterType <ISendMailService, SendMailTestMock>("SendMailTest");
            var    sndMail     = UContainer.Resolve <ISendMailService>("SendMailTest");
            var    mailSetting = UContainer.Resolve <MailSettingsViewModel>(new ParameterOverride("mailService", sndMail));
            string testString  = "Ihre Rechnung Nr. [RECHNUNGSNR] ausgestellt am [RECHNUNGSDATUM]";

            mailSetting.Subject = testString;
            mailSetting.SaveCommand.Execute(null);
            Assert.AreEqual(testString, PlugInSettings.Default.MailBetreff);
        }
コード例 #8
0
        public void MailSettingsViewModelTestMailOk()
        {
            UContainer.RegisterType <ISendMailService, SendMailTestMock>("SendMailTest");
            var sndMail     = UContainer.Resolve <ISendMailService>("SendMailTest");
            var mailSetting = UContainer.Resolve <MailSettingsViewModel>(new ParameterOverride("mailService", sndMail));

            mailSetting.IsValid();
            ListResults(mailSetting.Results);
            Assert.IsTrue(mailSetting.Results.IsValid);
            mailSetting.TestenCommand.Execute(null);
            Assert.IsTrue(string.IsNullOrEmpty(sndMail.SendTo));
        }
コード例 #9
0
        public void SendMailTestOk()
        {
            UContainer.RegisterType <ISendMailService, SendMailTestMock>("SendMailTest");
            var sndMail = UContainer.Resolve <ISendMailService>("SendMailTest");

            sndMail.MailBody    = "Servus";
            sndMail.PdfFileName = null;
            sndMail.SendTo      = "*****@*****.**";
            sndMail.Subject     = "Nachricht aus Unit-Test";
            sndMail.XmlFilename = null;

            sndMail.SendMail();
            Assert.IsNotNull(sndMail);
        }
コード例 #10
0
        public void RegisterEventSubscriber()
        {
            // Register SetDropDownSelection Event Handler
            EventBroker eb = UContainer.Resolve(typeof(EventBroker)) as EventBroker;

            eb.RegisterSubscriber(UpdatePropertyEventArgs.UpdateDropDownSelection, SetDropDownSelection);
            eb.RegisterSubscriber(UpdatePropertyEventArgs.UpdateProtectedProperty, UpdateProtectedProperty);
            eb.RegisterSubscriber(UpdatePropertyEventArgs.UpdateDocTable, UpdateDocTable);
            eb.RegisterSubscriber(InvoiceViewModel.InvoiceValidationOptionChanged, UpdateBookmarks);
            eb.RegisterSubscriber(UpdatePropertyEventArgs.ShowPanelEvent, ShowErrorPane);
            eb.RegisterSubscriber(InvoiceViewModel.SendMailEvent, OnSendMailEvent);
            eb.RegisterSubscriber(InvoiceViewModel.SaveAsPdfEvent, OnSaveAsPdfEvent);
            eb.RegisterSubscriber(InvoiceViewModel.DocumentHomeKey, OnDocumentHomeKey);
        }
コード例 #11
0
        public void GetRelatedDocumentEntryRelDocOkTest()
        {
            _rel = UContainer.Resolve <RelatedDocumentViewModel>();
            _rel.RefTypeSelected = RelatedDocumentViewModel.RefType.Verweis;
            _rel.RefInvNumber    = "123456";
            _rel.RefInvDate      = DateTime.Today;
            bool res = _rel.IsValid();

            ListResults(_rel.Results);
            Assert.AreEqual(true, res);
            var result = _rel.GetRelatedDocumentEntry(InvoiceSubtypes.ValidationRuleSet.Government);

            Assert.IsNotNull(result);
            Assert.IsInstanceOf <RelatedDocumentType>(result);
        }
コード例 #12
0
        private static void NewMethod()
        {
            ItemInfo info = new ItemInfo();

            info.Item = new EMin.Model.Collection.Pro_Item()
            {
                Detail    = "aaaaaaaaaa",
                IsOnSale  = true,
                UnitPrice = 37.5M,
                Title     = "ababababa",
            };

            info.ItemSkuList = new List <EMin.Model.Collection.Pro_ItemSku>()
            {
                new EMin.Model.Collection.Pro_ItemSku()
                {
                    IsOnSale  = true,
                    Pattern   = "",
                    UnitPrice = 37.5M,
                }
            };

            info.ImageList = new List <EMin.Model.Collection.Pro_ItemImage>()
            {
                new EMin.Model.Collection.Pro_ItemImage()
                {
                    Url = "http://image.51daigou.com//ProductImage/2014/4/24/20140424175739.jpg"
                },
                new EMin.Model.Collection.Pro_ItemImage()
                {
                    Url = "http://image.51daigou.com//ProductImage/japanamazon/9d8e5446490f5e3601e3f66c0d87aeda.jpg"
                },
                new EMin.Model.Collection.Pro_ItemImage()
                {
                    Url = "http://image.51daigou.com//ProductImage/japanamazon/0ad7351e141f59d4f75507de68a535e9.jpg"
                }
            };



            UContainer.Get <IItemInfo>().SaveItem(info);
        }
コード例 #13
0
        public void BicIbanNotOkTests()
        {
            var bsVm = UContainer.Resolve <BillerSettingsViewModel>();

            bsVm.Name    = "Tester";
            bsVm.Strasse = "Verkäuferstrasse";
            bsVm.Ort     = "Testort";
            bsVm.Plz     = "4711";
            bsVm.VatId   = PlugInSettings.VatIdDefaultMitVstBerechtigung;
            bool bsRc = bsVm.IsValid();

            Assert.IsTrue(bsRc, "IsValid nach Basis-Setup");
            bsVm.Bic = "VBWI12121212ATW1";
            bsRc     = bsVm.IsValid();
            ListResults(bsVm.Results);
            Assert.IsFalse(bsRc, "IsValid nach BIC falsch");
            bsVm.Iban = "AT5043000xx91919191919";
            bsRc      = bsVm.IsValid();
            ListResults(bsVm.Results);
            Assert.IsFalse(bsRc, "IsValid nach BIC und Iban falsch");
        }
コード例 #14
0
        public void RelatedDocumentViewModelStornNotoOkTest()
        {
            _rel = UContainer.Resolve <RelatedDocumentViewModel>();
            _rel.RefTypeSelected = RelatedDocumentViewModel.RefType.Storno;
            _rel.RefInvNumber    = "123456";
            bool res = _rel.IsValid();

            ListResults(_rel.Results);
            Assert.AreEqual(false, res);
            _rel = UContainer.Resolve <RelatedDocumentViewModel>();
            _rel.RefTypeSelected = RelatedDocumentViewModel.RefType.Storno;
            _rel.RefInvDate      = DateTime.Today;
            res = _rel.IsValid();
            ListResults(_rel.Results);
            Assert.AreEqual(false, res);
            _rel = UContainer.Resolve <RelatedDocumentViewModel>();
            _rel.RefTypeSelected = RelatedDocumentViewModel.RefType.Storno;
            _rel.RefComment      = ">".PadRight(300, '.');
            res = _rel.IsValid();
            ListResults(_rel.Results);
            Assert.AreEqual(false, res);
        }
コード例 #15
0
 public ItemDetailController()
 {
     ItemInfoService = UContainer.Get <IItemInfo>();
 }
コード例 #16
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form2 frm2 = UContainer.Resolve <Form2>();

            frm2.Show();
        }
コード例 #17
0
 public PluginContainer()
 {
     this.Container = new UContainer(new Unity.UnityContainer());
 }
コード例 #18
0
ファイル: BuyController.cs プロジェクト: rainbow-lpf/Ecore
 public BuyController()
 {
     ItemInfoService = UContainer.Get <IItemInfo>();
 }
コード例 #19
0
        public void BillerSettingsViewModelTestNewOk()
        {
            var bsVm = UContainer.Resolve <BillerSettingsViewModel>();

            Assert.AreEqual("EUR", bsVm.CurrSelected.Code);
        }
コード例 #20
0
        public void RegisterSingleEventSubscriber(string publishedEventName, System.EventHandler subscriber)
        {
            EventBroker eb = UContainer.Resolve(typeof(EventBroker)) as EventBroker;

            eb.RegisterSubscriber(publishedEventName, subscriber);
        }