Pokaż
Ignoruj:
Data:
2009-11-24 12:24:57 (16 years ago)
Autor:
alina
Opis:

re #215 zmiana parametrow w konstruktorze PlatnosciController?, dostosowanie testow do zmiany

Pliki:
1 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • trunk/eCard/eCardMVC/Platnosci.Tests/Web/TestMethods.cs

    r882 r896  
    1212    class TestMethods 
    1313    { 
    14         private string testNip1 = "12345"; 
    15         private int testIdFaktury = 1000; 
    16  
    1714        private Function _f = new Function(); 
    1815 
    19         [Test] 
    20         [Category("Unit")] 
    21         public void TestFindInvoiceByNumber() 
    22         { 
    23             FakeDataContext fake = new FakeDataContext(); 
    24             IRepository<vPlatnosciEcard> _rep = new Repository<vPlatnosciEcard>(fake); 
    25  
    26             vPlatnosciEcard platnosc = new vPlatnosciEcard(); 
    27             platnosc = _rep.FindInvoiceById(1).SingleOrDefault(); 
    28             Assert.That(platnosc.Faktura_Numer, Is.EqualTo("1")); 
    29         } 
    3016        [Test] 
    3117        [Category("Unit")] 
     
    3319        { 
    3420            FakeDataContext fake = new FakeDataContext(); 
    35             IRepository<vPlatnosciEcard> _rep = new Repository<vPlatnosciEcard>(fake); 
     21            var _rep = new Repository<vPlatnosciEcard>(fake); 
    3622 
    37             vPlatnosciEcard platnosc = _f.createPayment(testIdFaktury, testNip1, "", 0, 0); 
     23            vPlatnosciEcard platnosc = _f.createInvoice(123, "nip", "", 0, 0); 
    3824            _rep.Insert(platnosc); 
    3925 
    40             vPlatnosciEcard pl = _rep.FindInvoiceById(testIdFaktury).SingleOrDefault(); 
    41             Assert.That(pl.nip, Is.EqualTo(testNip1)); 
     26            System.Diagnostics.Debug.WriteLine("rep.Count: " + _rep.Count());             
     27            vPlatnosciEcard pl = _rep.FindOne(123); 
     28            System.Diagnostics.Debug.WriteLine("Wartosc nip ma byc 'nip'. Jest " + pl.nip); 
     29            Assert.That(pl.nip, Is.EqualTo("nip")); 
    4230        } 
    4331    }