PageRenderTime 17ms CodeModel.GetById 9ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.Tests/Account/Login.cs

#
C# | 33 lines | 27 code | 6 blank | 0 comment | 0 complexity | 0b936a915f0a8ed18f6233bec73005a9 MD5 | raw file
 1using NUnit.Framework;
 2
 3namespace BlogEngine.Tests.Account
 4{
 5    [TestFixture]
 6    public class Login : BeTest
 7    {
 8        readonly string LoginFailedMsg = "Login failed";
 9        readonly string WelcomeToBeMsg = "Welcome to BlogEngine.NET";
10
11        [SetUp]
12        public void Init()
13        {
14            Logout();
15        }
16
17        [Test]
18        public void InvalidLoginShouldFail()
19        {
20            Login("foo", "bar");
21
22            Assert.IsTrue(ie.ContainsText(LoginFailedMsg));
23        }
24
25        [Test]
26        public void ValidLoginShouldPass()
27        {
28            Login("admin");
29
30            Assert.IsTrue(ie.ContainsText(WelcomeToBeMsg));
31        }
32    }
33}