public void TestGetUserType(string login, string password, string expected) { SqlLogin sql = new SqlLogin(); if (expected == "Exception") { Assert.Throws <ArgumentException>(() => sql.GetUserType(login, password)); return; } Assert.Equal(expected, sql.GetUserType(login, password).Permission); }
public void TestChangePassword() { SqlLogin sql = new SqlLogin(); string login = "******"; string email = "*****@*****.**"; string newPassword = "******"; sql.ChangePassword(login, email, newPassword); IEnumerable <ClassUser> query = from elem in sql.ListUser where elem.Login == login && elem.Email == email select elem; Assert.Equal(newPassword, query.First().Password); }
public void TestCheckLoginAndEmail(string login, string email, bool expected) { SqlLogin sql = new SqlLogin(); Assert.Equal(expected, sql.CheckLoginAndEmail(login, email)); }
public void TsetCheckLoginDetails(string login, string password, bool expected) { SqlLogin sql = new SqlLogin(); Assert.Equal(expected, sql.CheckLoginDetails(login, password)); }