public static Client CreateClientCompanyWithoutDiscount() { PersonalData per = new PersonalData("Firma"); Address addr = new Address(); Regon reg = new Regon(); NIP nip = new NIP(); Client a = new Client(per, addr, reg, nip); return a; }
public ClientIM() { PersonalData per1 = new PersonalData("A", "B"); Address ad1 = new Address("S1", "12", "Wrocław", "12-456", "Poland"); Regon a1 = new Regon("2346789"); NIP a2 = new NIP("123123"); clients.Add(new Client(per1, ad1, a1, a2)); }
public static Client CreateClientCompanyWithDiscountZnizka() { PersonalData per = new PersonalData("Firma"); Address addr = new Address(); Regon reg = new Regon(); NIP nip = new NIP(); Client a = new Client(per, addr, reg, nip); Discount dis = new Discount(1, Bonus.Zniżka, 0.1f); a.AddDiscount(dis); return a; }
public Client FindNIP(NIP nip) { foreach (var a in clients) { if (nip == a.Nip) { return(a); } } return(null); }
public void NipThrowExceptionWrongNIP() { try { NIP np = new NIP("1234567890"); Assert.IsTrue(false); } catch (Exception e) { Assert.IsTrue(e.Message.Equals("Błąd w NIP-ie. Niepoprawne znaczenie.\n")); } }
public void NipThrowExceptionWrongNumber() { try { NIP np = new NIP("123456789A"); Assert.IsTrue(false); } catch (Exception e) { Assert.IsTrue(e.Message.Equals("Błąd w NIP-ie.Niewłaściwe znaki.\n")); } }
public void NipThrowExceptionToLongNip() { try { NIP np = new NIP("1123456789012"); Assert.IsTrue(false); } catch (Exception e) { Assert.IsTrue(e.Message.Equals("Błąd w NIP-ie. Zła długość.\n")); } }
public InvoiceIM() { PersonalData per1 = new PersonalData("A", "B"); Address ad1 = new Address("S1", "12", "Wrocław", "12-456", "Poland"); Regon a1 = new Regon("2346789"); NIP a2 = new NIP("123123"); Client b = new Client(per1, ad1, a1, a2); Price c3 = new Price(10, Waluta.PLN, 19.0f); Product a3 = new Product("Pierwsza rzecz", TypProduktu.Usługa, c3); Money a4 = new Money(123, Waluta.PLN); Item e = new Item(a3, 12); List <Item> d = new List <Item>(); d.Add(e); Invoice a = new Invoice("Faktura", b); invoices.Add(a); }
public Client FindNIP(NIP nip) { throw new NotImplementedException(); }