using adMoto.Payments.Core;
using adMoto.Payments.Core.Data;
using NUnit.Framework;

namespace adMoto.Payments.Test.Web
{
    [TestFixture]
    public class TestMethods
    {
        private readonly Function _function = new Function();

        [Test]
        [Category("Unit")]
        public void TestInsertMethodForPayment()
        {
            var fake = new FakeDataContext();
            var vPlatnosciEcardRepository = new Repository<Invoice>(fake);

            var platnosc = _function.CreateInvoice(123, "nip", "", 0, 0);
            vPlatnosciEcardRepository.Insert(platnosc);

            System.Diagnostics.Debug.WriteLine("rep.Count: " + vPlatnosciEcardRepository.Count());
            var pl = vPlatnosciEcardRepository.FindOne(123);
            System.Diagnostics.Debug.WriteLine("Wartosc nip ma byc 'nip'. Jest " + pl.nip);
            Assert.That(pl.nip, Is.EqualTo("nip"));
        }
    }
}