using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Platnosci.Core.Linq;
using System.Web.Mvc;
using Moq;

namespace Platnosci.Tests.Web
{
    public class Function
    {
        public vPlatnosciEcard createPayment(int id, string nip, string fak_numer, decimal brutto, byte SystemKsiegowy)
        {

            vPlatnosciEcard platnosc = new vPlatnosciEcard();
            platnosc.ID_faktury = id;
            platnosc.nip = nip;
            platnosc.Faktura_Numer = fak_numer;
            platnosc.Brutto = brutto;
            platnosc.SystemKsiegowyId = SystemKsiegowy;

            return platnosc;
        }
        public PlatnosciEcard createNewPayment(int ordernumber, bool status, DateTime data, int id_faktury)
        {
            PlatnosciEcard platnosc = new PlatnosciEcard();
            platnosc.ORDERNUMBER = ordernumber;
            platnosc.Status = status;
            platnosc.Status_data = data;
            platnosc.IDFaktury = id_faktury;

            return platnosc;
        }
        public Payer createPayer(int id, string name, string surname)
        {
            Payer payer = new Payer();
            payer.Id_faktury = id;
            payer.FirstName = name;
            payer.LastName = surname;

            return payer;
        }
        public ControllerContext createControllerContext(string UserIdentity)
        {

            var mock = new Mock<ControllerContext>();
            mock.SetupGet(m => m.HttpContext.User.Identity.Name).Returns(UserIdentity);
            mock.SetupGet(m => m.HttpContext.Request.IsAuthenticated).Returns(true);
           
            return mock.Object;
        }
    }
}
