Pokaż
Ignoruj:
Data:
2010-01-04 15:10:02 (16 years ago)
Autor:
alina
Opis:

re #215 dodanie klasy bazowej dla testow interfejsowych

Pliki:
1 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • trunk/eCard/eCardMVC/adMoto.Payments.Test/UI/UIHelper.cs

    r990 r991  
    1515    { 
    1616        private readonly TestDataHelper _testDataHelper = new TestDataHelper(); 
    17         private IRepository<FAKTURY> _repInvoices; 
    18         private IRepository<FAKTURA_DETAIL> _repInvoiceDetails; 
     17        private IRepository<FAKTURY> _repInvoices = new Repository<FAKTURY>(new DataContext()); 
     18        private IRepository<FAKTURA_DETAIL> _repInvoiceDetails = new Repository<FAKTURA_DETAIL>(new DataContext()); 
    1919        private IRepository<PlatnosciEcard> _repPayment; 
    2020        private UIData uiData; 
     
    2626        public UIData CreateAndAddTestRecordToRepository(int amount) 
    2727        {     
    28             _repInvoices = new Repository<FAKTURY>(new DataContext()); 
    2928            var invoices = new FAKTURY 
    3029                               { 
     
    4342            if (invoice != null) 
    4443            { 
    45                 _repInvoiceDetails = new Repository<FAKTURA_DETAIL>(new DataContext()); 
    4644                var invoiceDetails = new FAKTURA_DETAIL 
    4745                                        { 
     
    9088                _repPayment.Delete(payment); 
    9189        } 
     90 
     91        public void SearchAndClean() 
     92        { 
     93            var invoices = _repInvoices.FindAll(p => p.NUMER == 1 && p.NUMER_ROK == 1 && p.NUMER_ROZ == "SLJ" && p.ID_NABYWCY == 76131); 
     94            System.Diagnostics.Debug.WriteLine(" count: " + invoices.Count); 
     95            for (int i = 0; i < invoices.Count; i++) 
     96            { 
     97                var id_faktury = invoices[i].ID_FAKTURY; 
     98                System.Diagnostics.Debug.WriteLine(" id faktury: " + invoices[i].ID_FAKTURY + "\n"); 
     99                if (invoices[i] != null) 
     100                    _repInvoices.Delete(invoices[i]); 
     101 
     102                var invoiceDetails = _repInvoiceDetails.FindOne(p => p.ID_FAKTURY == id_faktury); 
     103                if (invoiceDetails != null) 
     104                    _repInvoiceDetails.Delete(invoiceDetails); 
     105            } 
     106        } 
    92107         
    93108        public void CloseWebBrowser(IE ie)