| [882] | 1 | using System;
|
|---|
| [970] | 2 | using adMoto.Payments.Core;
|
|---|
| 3 | using adMoto.Payments.Core.Data;
|
|---|
| [882] | 4 | using System.Web.Mvc;
|
|---|
| 5 | using Moq;
|
|---|
| 6 |
|
|---|
| [982] | 7 | namespace adMoto.Payments.Test.Fakes
|
|---|
| [882] | 8 | {
|
|---|
| [982] | 9 | public class TestDataHelper
|
|---|
| [882] | 10 | {
|
|---|
| [970] | 11 | public Invoice CreateInvoice(int id, string nip, string invoiceNumber, decimal brutto, byte systemKsiegowy)
|
|---|
| [882] | 12 | {
|
|---|
| [984] | 13 | var invoice = new Invoice();
|
|---|
| 14 | invoice.ID_faktury = id;
|
|---|
| 15 | invoice.nip = nip;
|
|---|
| 16 | invoice.Faktura_Numer = invoiceNumber;
|
|---|
| 17 | invoice.Brutto = brutto;
|
|---|
| 18 | invoice.SystemKsiegowyId = systemKsiegowy;
|
|---|
| [882] | 19 |
|
|---|
| [984] | 20 | return invoice;
|
|---|
| [882] | 21 | }
|
|---|
| [970] | 22 | public Invoice CreateForeignInvoice(int id, string nip, string invoiceNumber, decimal brutto, byte systemKsiegowy, decimal walutaBrutto, string currency)
|
|---|
| [951] | 23 | {
|
|---|
| [984] | 24 | var invoice = new Invoice();
|
|---|
| 25 | invoice.ID_faktury = id;
|
|---|
| 26 | invoice.nip = nip;
|
|---|
| 27 | invoice.Faktura_Numer = invoiceNumber;
|
|---|
| 28 | invoice.Brutto = brutto;
|
|---|
| 29 | invoice.waluta_brutto = walutaBrutto;
|
|---|
| 30 | invoice.waluta_miano = currency.ToUpper();
|
|---|
| 31 | invoice.SystemKsiegowyId = systemKsiegowy;
|
|---|
| [951] | 32 |
|
|---|
| [984] | 33 | return invoice;
|
|---|
| [951] | 34 | }
|
|---|
| [931] | 35 | public PlatnosciEcard CreateNewPayment(int orderNumber, bool status, DateTime data, int invoiceId)
|
|---|
| [882] | 36 | {
|
|---|
| [984] | 37 | var payment = new PlatnosciEcard();
|
|---|
| 38 | payment.ORDERNUMBER = orderNumber;
|
|---|
| 39 | payment.Status = status;
|
|---|
| 40 | payment.Status_data = data;
|
|---|
| 41 | payment.IDFaktury = invoiceId;
|
|---|
| [882] | 42 |
|
|---|
| [984] | 43 | return payment;
|
|---|
| [882] | 44 | }
|
|---|
| [930] | 45 | public PotwierdzeniaEcard CreateConfirm(string code, int ordernumber)
|
|---|
| [896] | 46 | {
|
|---|
| [930] | 47 | var potwierdzenie = new PotwierdzeniaEcard();
|
|---|
| [896] | 48 | potwierdzenie.CURRENTSTATE = code;
|
|---|
| 49 | potwierdzenie.ORDERNUMBER = ordernumber;
|
|---|
| 50 |
|
|---|
| 51 | return potwierdzenie;
|
|---|
| 52 | }
|
|---|
| [930] | 53 |
|
|---|
| 54 | public Payer CreatePayer(int id, string name, string surname)
|
|---|
| [882] | 55 | {
|
|---|
| [930] | 56 | var payer = new Payer {Id_faktury = id, FirstName = name, LastName = surname};
|
|---|
| [882] | 57 |
|
|---|
| 58 | return payer;
|
|---|
| 59 | }
|
|---|
| [930] | 60 |
|
|---|
| [931] | 61 | public ControllerContext CreateControllerContext(string userIdentity)
|
|---|
| [882] | 62 | {
|
|---|
| 63 | var mock = new Mock<ControllerContext>();
|
|---|
| [931] | 64 | mock.SetupGet(m => m.HttpContext.User.Identity.Name).Returns(userIdentity);
|
|---|
| [882] | 65 | mock.SetupGet(m => m.HttpContext.Request.IsAuthenticated).Returns(true);
|
|---|
| [888] | 66 |
|
|---|
| [882] | 67 | return mock.Object;
|
|---|
| 68 | }
|
|---|
| 69 | }
|
|---|
| [982] | 70 | } |
|---|