﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Platnosci.Core.Linq;
using Platnosci.Core.Interface;

namespace Platnosci.Tests.Web
{
    [TestFixture]
    class TestMethods
    {
        private Function _f = new Function();

        [Test]
        [Category("Unit")]
        public void TestInsertMethodForPayment()
        {
            FakeDataContext fake = new FakeDataContext();
            var _rep = new Repository<vPlatnosciEcard>(fake);

            vPlatnosciEcard platnosc = _f.createInvoice(123, "nip", "", 0, 0);
            _rep.Insert(platnosc);

            System.Diagnostics.Debug.WriteLine("rep.Count: " + _rep.Count());            
            vPlatnosciEcard pl = _rep.FindOne(123);
            System.Diagnostics.Debug.WriteLine("Wartosc nip ma byc 'nip'. Jest " + pl.nip);
            Assert.That(pl.nip, Is.EqualTo("nip"));
        }
    }
}
