public void RelatedDocumentViewModelKeinSelectedTest() { _rel = UContainer.Resolve <RelatedDocumentViewModel>(); bool res = _rel.IsValid(); Assert.AreEqual(true, res); }
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"); }
public void RelatedDocumentViewModelVerweisNoDateOkTest() { _rel = UContainer.Resolve <RelatedDocumentViewModel>(); _rel.RefTypeSelected = RelatedDocumentViewModel.RefType.Verweis; _rel.RefInvNumber = "123456"; bool res = _rel.IsValid(); Assert.AreEqual(true, res); }
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 }
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); }
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); }
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); }
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)); }
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); }
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); }
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); }
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); }
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"); }
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); }
public ItemDetailController() { ItemInfoService = UContainer.Get <IItemInfo>(); }
private void button1_Click(object sender, EventArgs e) { Form2 frm2 = UContainer.Resolve <Form2>(); frm2.Show(); }
public PluginContainer() { this.Container = new UContainer(new Unity.UnityContainer()); }
public BuyController() { ItemInfoService = UContainer.Get <IItemInfo>(); }
public void BillerSettingsViewModelTestNewOk() { var bsVm = UContainer.Resolve <BillerSettingsViewModel>(); Assert.AreEqual("EUR", bsVm.CurrSelected.Code); }
public void RegisterSingleEventSubscriber(string publishedEventName, System.EventHandler subscriber) { EventBroker eb = UContainer.Resolve(typeof(EventBroker)) as EventBroker; eb.RegisterSubscriber(publishedEventName, subscriber); }