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 UIAccountTest
    {
        [Test]
        [Category("UI")]
        public void checkLoginCorrect()
        {
            IE ie = new IE("http://localhost:3646/pl/Account/LogOn");
            ie.TextField(Find.ByName("numer_faktury")).TypeText("24/HOL/2009");
            ie.TextField(Find.ByName("nip")).TypeText("501379568");
            ie.Button(Find.ById("loguj")).Click();
            Assert.IsTrue(ie.ContainsText("została uregulowana"));
        }
        [Test]
        [Category("UI")]
        public void checkErrorLogin()
        {
            IE ie = new IE("http://localhost:3646/pl/Account/LogOn");
            ie.TextField(Find.ByName("numer_faktury")).TypeText("");
            ie.TextField(Find.ByName("nip")).TypeText("");
            ie.Button(Find.ById("loguj")).Click();
            Assert.IsTrue(ie.ContainsText("Logowanie nie powiodło się"));
        }
    }
}
