| 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 | {
|
|---|
| 10 | public vPlatnosciEcard CreateInvoice(int id, string nip, string invoiceNumber, decimal brutto, byte systemKsiegowy)
|
|---|
| 11 | {
|
|---|
| 12 | var platnosc = new vPlatnosciEcard();
|
|---|
| 13 | platnosc.ID_faktury = id;
|
|---|
| 14 | platnosc.nip = nip;
|
|---|
| 15 | platnosc.Faktura_Numer = invoiceNumber;
|
|---|
| 16 | platnosc.Brutto = brutto;
|
|---|
| 17 | platnosc.SystemKsiegowyId = systemKsiegowy;
|
|---|
| 18 | //platnosc.waluta_miano
|
|---|
| 19 |
|
|---|
| 20 | return platnosc;
|
|---|
| 21 | }
|
|---|
| 22 | public PlatnosciEcard CreateNewPayment(int orderNumber, bool status, DateTime data, int invoiceId)
|
|---|
| 23 | {
|
|---|
| 24 | var platnosc = new PlatnosciEcard();
|
|---|
| 25 | platnosc.ORDERNUMBER = orderNumber;
|
|---|
| 26 | platnosc.Status = status;
|
|---|
| 27 | platnosc.Status_data = data;
|
|---|
| 28 | platnosc.IDFaktury = invoiceId;
|
|---|
| 29 |
|
|---|
| 30 | return platnosc;
|
|---|
| 31 | }
|
|---|
| 32 | public PotwierdzeniaEcard CreateConfirm(string code, int ordernumber)
|
|---|
| 33 | {
|
|---|
| 34 | var potwierdzenie = new PotwierdzeniaEcard();
|
|---|
| 35 | potwierdzenie.CURRENTSTATE = code;
|
|---|
| 36 | potwierdzenie.ORDERNUMBER = ordernumber;
|
|---|
| 37 |
|
|---|
| 38 | return potwierdzenie;
|
|---|
| 39 | }
|
|---|
| 40 |
|
|---|
| 41 | public Payer CreatePayer(int id, string name, string surname)
|
|---|
| 42 | {
|
|---|
| 43 | var payer = new Payer {Id_faktury = id, FirstName = name, LastName = surname};
|
|---|
| 44 |
|
|---|
| 45 | return payer;
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | public ControllerContext CreateControllerContext(string userIdentity)
|
|---|
| 49 | {
|
|---|
| 50 |
|
|---|
| 51 | var mock = new Mock<ControllerContext>();
|
|---|
| 52 | mock.SetupGet(m => m.HttpContext.User.Identity.Name).Returns(userIdentity);
|
|---|
| 53 | mock.SetupGet(m => m.HttpContext.Request.IsAuthenticated).Returns(true);
|
|---|
| 54 |
|
|---|
| 55 | return mock.Object;
|
|---|
| 56 | }
|
|---|
| 57 | }
|
|---|
| 58 | }
|
|---|