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

Wersja 888, 1.7 KB (wprowadzona przez alina, 16 years temu)

re #215

Line 
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    {
13        public vPlatnosciEcard createPayment(int id, string nip, string fak_numer, decimal brutto, byte SystemKsiegowy)
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        }
35        public Payer createPayer(int id, string name, string surname)
36        {
37            Payer payer = new Payer();
38            payer.Id_faktury = id;
39            payer.FirstName = name;
40            payer.LastName = surname;
41
42            return payer;
43        }
44        public ControllerContext createControllerContext(string UserIdentity)
45        {
46
47            var mock = new Mock<ControllerContext>();
48            mock.SetupGet(m => m.HttpContext.User.Identity.Name).Returns(UserIdentity);
49            mock.SetupGet(m => m.HttpContext.Request.IsAuthenticated).Returns(true);
50           
51            return mock.Object;
52        }
53    }
54}
Notatka: Zobacz TracBrowser aby uzyskać więcej informacji.