| [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;
|
|---|
| [950] | 18 | //platnosc.waluta_miano
|
|---|
| [882] | 19 |
|
|---|
| 20 | return platnosc;
|
|---|
| 21 | }
|
|---|
| [931] | 22 | public PlatnosciEcard CreateNewPayment(int orderNumber, bool status, DateTime data, int invoiceId)
|
|---|
| [882] | 23 | {
|
|---|
| [930] | 24 | var platnosc = new PlatnosciEcard();
|
|---|
| [931] | 25 | platnosc.ORDERNUMBER = orderNumber;
|
|---|
| [882] | 26 | platnosc.Status = status;
|
|---|
| 27 | platnosc.Status_data = data;
|
|---|
| [931] | 28 | platnosc.IDFaktury = invoiceId;
|
|---|
| [882] | 29 |
|
|---|
| 30 | return platnosc;
|
|---|
| 31 | }
|
|---|
| [930] | 32 | public PotwierdzeniaEcard CreateConfirm(string code, int ordernumber)
|
|---|
| [896] | 33 | {
|
|---|
| [930] | 34 | var potwierdzenie = new PotwierdzeniaEcard();
|
|---|
| [896] | 35 | potwierdzenie.CURRENTSTATE = code;
|
|---|
| 36 | potwierdzenie.ORDERNUMBER = ordernumber;
|
|---|
| 37 |
|
|---|
| 38 | return potwierdzenie;
|
|---|
| 39 | }
|
|---|
| [930] | 40 |
|
|---|
| 41 | public Payer CreatePayer(int id, string name, string surname)
|
|---|
| [882] | 42 | {
|
|---|
| [930] | 43 | var payer = new Payer {Id_faktury = id, FirstName = name, LastName = surname};
|
|---|
| [882] | 44 |
|
|---|
| 45 | return payer;
|
|---|
| 46 | }
|
|---|
| [930] | 47 |
|
|---|
| [931] | 48 | public ControllerContext CreateControllerContext(string userIdentity)
|
|---|
| [882] | 49 | {
|
|---|
| 50 |
|
|---|
| 51 | var mock = new Mock<ControllerContext>();
|
|---|
| [931] | 52 | mock.SetupGet(m => m.HttpContext.User.Identity.Name).Returns(userIdentity);
|
|---|
| [882] | 53 | mock.SetupGet(m => m.HttpContext.Request.IsAuthenticated).Returns(true);
|
|---|
| [888] | 54 |
|
|---|
| [882] | 55 | return mock.Object;
|
|---|
| 56 | }
|
|---|
| 57 | }
|
|---|
| 58 | }
|
|---|