using NUnit.Framework;
using WatiN.Core;

namespace Platnosci.Tests.Web
{
    [TestFixture]
    public class UIAccountTest
    {
        [Test]
        [Category("UI")]
        public void CheckErrorLogin()
        {
            var ie = new IE("http://localhost:3646/pl/Account/LogOn");
            ie.TextField(Find.ByName("numerFaktury")).TypeText("");
            ie.TextField(Find.ByName("nip")).TypeText("");
            ie.Button(Find.ById("loguj")).Click();
            Assert.IsTrue(ie.ContainsText("Logowanie nie powiodło się"));
            ie.ForceClose();
            ie.Close();
            ie.Dispose();
        }

        [Test]
        [Category("UI")]
        public void CheckLoginCorrect()
        {
            var ie = new IE("http://localhost:3646/pl/Account/LogOn");
            ie.TextField(Find.ByName("numerFaktury")).TypeText("24/HOL/2009");
            ie.TextField(Find.ByName("nip")).TypeText("501379568");
            ie.Button(Find.ById("loguj")).Click();
            Assert.IsTrue(ie.ContainsText("została uregulowana"));
            ie.ForceClose();
            ie.Close();
            ie.Dispose();
        }
    }
}