| | 11 | private UIData uiData; |
| | 12 | private const string test = "test"; |
| | 13 | |
| | 14 | [SetUp] |
| | 15 | public void SetUp() |
| | 16 | { |
| | 17 | System.Diagnostics.Debug.WriteLine("nowy test"); |
| | 18 | _uiHelper.SearchAndClean(); |
| | 19 | ie.GoTo(adres); |
| | 20 | } |
| | 21 | |
| | 22 | [Test] |
| | 23 | [Category("UI")] |
| | 24 | public void Returns_ZlyHash_When_Invoice_Amount_Is_Zero() |
| | 25 | { |
| | 26 | // wartosc testowej faktury 1/SLJ/1 jest 0 (zero) |
| | 27 | // wowczas eCard powinien zwrocic zlyHash - stala informujaca, ze cos jest nie tak... |
| | 28 | uiData = _uiHelper.CreateAndAddTestRecordToRepository(0); |
| | 29 | |
| | 30 | ie.TextField(Find.ByName("numerFaktury")).TypeText(uiData.Test_numer_faktury); |
| | 31 | ie.TextField(Find.ByName("nip")).TypeText(uiData.Test_nip); |
| | 32 | ie.Button(Find.ById("loguj")).Click(); |
| | 33 | |
| | 34 | ie.TextField(Find.ByName("Payer.FirstName")).TypeText(test); |
| | 35 | ie.TextField(Find.ByName("Payer.LastName")).TypeText(test); |
| | 36 | ie.Button(Find.ById("place")).Click(); |
| | 37 | Assert.IsTrue(ie.ContainsText("Wystąpił nieoczekiwany błąd")); |
| | 38 | |
| | 39 | //usuniecie rekordu z tabel: FAKTURY, FAKTURA_DETAILS |
| | 40 | _uiHelper.DeleteTestRecordsFromRepository(uiData); |
| | 41 | } |
| 41 | | |
| 42 | | [Test] |
| 43 | | [Category("UI")] |
| 44 | | public void Returns_ZlyHash_When_Invoice_Amount_Is_Zero() |
| 45 | | { |
| 46 | | // wartosc testowej faktury 1/SLJ/1 jest 0 (zero) |
| 47 | | // wowczas eCard powinien zwrocic zlyHash - stala informujaca, ze cos jest nie tak... |
| 48 | | var uiData = _uiHelper.CreateAndAddTestRecordToRepository(0); |
| 49 | | |
| 50 | | const string test = "test"; |
| 51 | | uiData.Test_surname = test; |
| 52 | | uiData.Test_firstname = test; |
| 53 | | |
| 54 | | var ie = new IE(adres); |
| 55 | | ie.TextField(Find.ByName("numerFaktury")).TypeText(uiData.Test_numer_faktury); |
| 56 | | ie.TextField(Find.ByName("nip")).TypeText(uiData.Test_nip); |
| 57 | | ie.Button(Find.ById("loguj")).Click(); |
| 58 | | |
| 59 | | ie.TextField(Find.ByName("Payer.FirstName")).TypeText(test); |
| 60 | | ie.TextField(Find.ByName("Payer.LastName")).TypeText(test); |
| 61 | | ie.Button(Find.ById("place")).Click(); |
| 62 | | Assert.IsTrue(ie.ContainsText("Wystąpił nieoczekiwany błąd")); |
| 63 | | _uiHelper.CloseWebBrowser(ie); |
| 64 | | |
| 65 | | //usuniecie rekordu z tabel: FAKTURY, FAKTURA_DETAILS |
| 66 | | _uiHelper.DeleteTestRecordsFromRepository(uiData); |
| 67 | | } |
| | 66 | |