using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using WatiN.Core;
using System.Web.Mvc;

namespace Platnosci.Tests.Web
{
    [TestFixture]
    public class UIPlatnosciTests
    {
        [Test]
        [Category("UI")]
        public void checkErrorPay()
        {
            string test = "test";
            IE ie = new IE("http://localhost:3646/pl/Account/LogOn");
            ie.TextField(Find.ByName("numer_faktury")).TypeText("27/ASZ/2009");
            ie.TextField(Find.ByName("nip")).TypeText("854956281");
            ie.Button(Find.ById("loguj")).Click();

            ie.TextField(Find.ByName("Payer.FirstName")).TypeText(test);
            ie.TextField(Find.ByName("Payer.LastName")).TypeText("");
            ie.Button(Find.ById("place")).Click();
            Assert.IsTrue(ie.ContainsText("Proszę podać"));
        }
        [Test]
        [Category("UI")]
        public void checkCorrectPay()
        {
            string test = "test";
            IE ie = new IE("http://localhost:3646/pl/Account/LogOn");
            ie.TextField(Find.ByName("numer_faktury")).TypeText("27/ASZ/2009");
            ie.TextField(Find.ByName("nip")).TypeText("854956281");
            ie.Button(Find.ById("loguj")).Click();

            ie.TextField(Find.ByName("Payer.FirstName")).TypeText(test);
            ie.TextField(Find.ByName("Payer.LastName")).TypeText(test);
            ie.Button(Find.ById("place")).Click();
            Assert.IsTrue(ie.ContainsText("Imię i nazwisko:" + test + " " + test));
        }
    }
}
