| [882] | 1 | using System;
|
|---|
| 2 | using Platnosci.Core.Linq;
|
|---|
| 3 | using System.Web.Mvc;
|
|---|
| 4 | using Moq;
|
|---|
| 5 |
|
|---|
| 6 | namespace Platnosci.Tests.Web
|
|---|
| 7 | {
|
|---|
| 8 | public class Function
|
|---|
| 9 | {
|
|---|
| [931] | 10 | public vPlatnosciEcard CreateInvoice(int id, string nip, string invoiceNumber, decimal brutto, byte systemKsiegowy)
|
|---|
| [882] | 11 | {
|
|---|
| [930] | 12 | var platnosc = new vPlatnosciEcard();
|
|---|
| [882] | 13 | platnosc.ID_faktury = id;
|
|---|
| 14 | platnosc.nip = nip;
|
|---|
| [931] | 15 | platnosc.Faktura_Numer = invoiceNumber;
|
|---|
| [882] | 16 | platnosc.Brutto = brutto;
|
|---|
| [931] | 17 | platnosc.SystemKsiegowyId = systemKsiegowy;
|
|---|
| [882] | 18 |
|
|---|
| 19 | return platnosc;
|
|---|
| 20 | }
|
|---|
| [931] | 21 | public PlatnosciEcard CreateNewPayment(int orderNumber, bool status, DateTime data, int invoiceId)
|
|---|
| [882] | 22 | {
|
|---|
| [930] | 23 | var platnosc = new PlatnosciEcard();
|
|---|
| [931] | 24 | platnosc.ORDERNUMBER = orderNumber;
|
|---|
| [882] | 25 | platnosc.Status = status;
|
|---|
| 26 | platnosc.Status_data = data;
|
|---|
| [931] | 27 | platnosc.IDFaktury = invoiceId;
|
|---|
| [882] | 28 |
|
|---|
| 29 | return platnosc;
|
|---|
| 30 | }
|
|---|
| [930] | 31 | public PotwierdzeniaEcard CreateConfirm(string code, int ordernumber)
|
|---|
| [896] | 32 | {
|
|---|
| [930] | 33 | var potwierdzenie = new PotwierdzeniaEcard();
|
|---|
| [896] | 34 | potwierdzenie.CURRENTSTATE = code;
|
|---|
| 35 | potwierdzenie.ORDERNUMBER = ordernumber;
|
|---|
| 36 |
|
|---|
| 37 | return potwierdzenie;
|
|---|
| 38 | }
|
|---|
| [930] | 39 |
|
|---|
| 40 | public Payer CreatePayer(int id, string name, string surname)
|
|---|
| [882] | 41 | {
|
|---|
| [930] | 42 | var payer = new Payer {Id_faktury = id, FirstName = name, LastName = surname};
|
|---|
| [882] | 43 |
|
|---|
| 44 | return payer;
|
|---|
| 45 | }
|
|---|
| [930] | 46 |
|
|---|
| [931] | 47 | public ControllerContext CreateControllerContext(string userIdentity)
|
|---|
| [882] | 48 | {
|
|---|
| 49 |
|
|---|
| 50 | var mock = new Mock<ControllerContext>();
|
|---|
| [931] | 51 | mock.SetupGet(m => m.HttpContext.User.Identity.Name).Returns(userIdentity);
|
|---|
| [882] | 52 | mock.SetupGet(m => m.HttpContext.Request.IsAuthenticated).Returns(true);
|
|---|
| [888] | 53 |
|
|---|
| [882] | 54 | return mock.Object;
|
|---|
| 55 | }
|
|---|
| 56 | }
|
|---|
| 57 | }
|
|---|