root/trunk/eCard/eCardMVC/Platnosci.Tests/Web/Function.cs @ 896

Wersja 896, 2.0 KB (wprowadzona przez alina, 16 years temu)

re #215 zmiana parametrow w konstruktorze PlatnosciController?, dostosowanie testow do zmiany

RevLine 
[882]1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Platnosci.Core.Linq;
6using System.Web.Mvc;
7using Moq;
8
9namespace Platnosci.Tests.Web
10{
11    public class Function
12    {
[896]13        public vPlatnosciEcard createInvoice(int id, string nip, string fak_numer, decimal brutto, byte SystemKsiegowy)
[882]14        {
15
16            vPlatnosciEcard platnosc = new vPlatnosciEcard();
17            platnosc.ID_faktury = id;
18            platnosc.nip = nip;
19            platnosc.Faktura_Numer = fak_numer;
20            platnosc.Brutto = brutto;
21            platnosc.SystemKsiegowyId = SystemKsiegowy;
22
23            return platnosc;
24        }
25        public PlatnosciEcard createNewPayment(int ordernumber, bool status, DateTime data, int id_faktury)
26        {
27            PlatnosciEcard platnosc = new PlatnosciEcard();
28            platnosc.ORDERNUMBER = ordernumber;
29            platnosc.Status = status;
30            platnosc.Status_data = data;
31            platnosc.IDFaktury = id_faktury;
32
33            return platnosc;
34        }
[896]35        public PotwierdzeniaEcard createConfirm(string code, int ordernumber)
36        {
37            PotwierdzeniaEcard potwierdzenie = new PotwierdzeniaEcard();
38            potwierdzenie.CURRENTSTATE = code;
39            potwierdzenie.ORDERNUMBER = ordernumber;
40
41            return potwierdzenie;
42        }
[882]43        public Payer createPayer(int id, string name, string surname)
44        {
45            Payer payer = new Payer();
46            payer.Id_faktury = id;
47            payer.FirstName = name;
48            payer.LastName = surname;
49
50            return payer;
51        }
52        public ControllerContext createControllerContext(string UserIdentity)
53        {
54
55            var mock = new Mock<ControllerContext>();
56            mock.SetupGet(m => m.HttpContext.User.Identity.Name).Returns(UserIdentity);
57            mock.SetupGet(m => m.HttpContext.Request.IsAuthenticated).Returns(true);
[888]58           
[882]59            return mock.Object;
60        }
61    }
62}
Notatka: Zobacz TracBrowser aby uzyskać więcej informacji.