Ejemplo n.º 1
0
        public void TestIsEmptyValid2()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            PasswordBox            testPasswordBox = new PasswordBox();

            Assert.True(v.IsEmpty(testPasswordBox));
        }
Ejemplo n.º 2
0
        public void TestIsEmptyValid1()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            TextBox testTextBox      = new TextBox();

            Assert.True(v.IsEmpty(testTextBox));
        }
Ejemplo n.º 3
0
        public void TestEmailExistsValid()
        {
            Books365.BLL.Validator v     = new Books365.BLL.Validator();
            TextBox     testFirstNameBox = new TextBox();
            TextBox     testLastNameBox  = new TextBox();
            PasswordBox testPasswordBox  = new PasswordBox();
            TextBox     testEmailBox     = new TextBox();
            TextBox     testSecretPinBox = new TextBox();

            testFirstNameBox.Text    = "name";
            testLastNameBox.Text     = "surname";
            testPasswordBox.Password = "******";
            testEmailBox.Text        = "*****@*****.**";
            testSecretPinBox.Text    = "1234";

            Books365.BLL.User user = new Books365.BLL.User();
            using (Books365.AppContext db = new Books365.AppContext())
            {
                user.AddNewUser(testFirstNameBox, testLastNameBox, testPasswordBox, testEmailBox, testSecretPinBox);
                Assert.True(v.EmailExists(testEmailBox));
                db.Users.RemoveRange(db.Users.Where(u => u.Email == testEmailBox.Text));
                db.EmailCurrentUser.RemoveRange(db.EmailCurrentUser.Where(u => u.Email == testEmailBox.Text));
                db.SaveChanges();
            }
        }
Ejemplo n.º 4
0
        public void TestPasswordValid2()
        {
            TextBox testTextBox = new TextBox();

            testTextBox.Text = "Pa$$word123";
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            Assert.True(v.PasswordIsCorrect(testTextBox));
        }
Ejemplo n.º 5
0
        public void TestIsEmptyInvalid2()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            PasswordBox            testPasswordBox = new PasswordBox();

            testPasswordBox.Password = "******";
            Assert.False(v.IsEmpty(testPasswordBox));
        }
Ejemplo n.º 6
0
        public void TestIsEmptyIvalid1()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            TextBox testTextBox      = new TextBox();

            testTextBox.Text = "11";
            Assert.False(v.IsEmpty(testTextBox));
        }
Ejemplo n.º 7
0
        public void TestSecretPinorrectValid()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            TextBox testTextBox      = new TextBox();

            testTextBox.Text = "3344";
            Assert.True(v.SecretPinIsCorrect(testTextBox));
        }
Ejemplo n.º 8
0
        public void TestEmailExistsInValid()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            TextBox testEmailBox     = new TextBox();

            testEmailBox.Text = "*****@*****.**";
            Assert.False(v.EmailExists(testEmailBox));
        }
Ejemplo n.º 9
0
        public void TestEmailIsCorrectValid()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            TextBox testEmailBox     = new TextBox();

            testEmailBox.Text = "*****@*****.**";
            Assert.True(v.EmailIsCorrect(testEmailBox));
        }
Ejemplo n.º 10
0
        public void TestPasswordInValid2()
        {
            PasswordBox testPasswordBox = new PasswordBox();

            testPasswordBox.Password = "******";
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            Assert.False(v.PasswordIsCorrect(testPasswordBox));
        }
Ejemplo n.º 11
0
        public void TestPasswordValid1()
        {
            PasswordBox testPasswordBox = new PasswordBox();

            testPasswordBox.Password = "******";
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            Assert.True(v.PasswordIsCorrect(testPasswordBox));
        }
Ejemplo n.º 12
0
        public void TestPasswordInValid4()
        {
            TextBox testTextBox = new TextBox();

            testTextBox.Text = "password1234";
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            Assert.False(v.PasswordIsCorrect(testTextBox));
        }
Ejemplo n.º 13
0
        public void TestYearInvalid2()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            TextBox testYearBox      = new TextBox();

            testYearBox.Text = "2100";
            Assert.False(v.YearIsValid(testYearBox));
        }
Ejemplo n.º 14
0
        public void TestYearValid()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            TextBox testYearBox      = new TextBox();

            testYearBox.Text = "1994";
            Assert.True(v.YearIsValid(testYearBox));
        }
Ejemplo n.º 15
0
        public void TestSecretPinorrectInvalid2()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            TextBox testTextBox      = new TextBox();

            testTextBox.Text = "32334";
            Assert.False(v.SecretPinIsCorrect(testTextBox));
        }
Ejemplo n.º 16
0
        public void TestEmailIsCorrectInvalid2()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            TextBox testEmailBox     = new TextBox();

            testEmailBox.Text = "t@gmailcom";
            Assert.False(v.EmailIsCorrect(testEmailBox));
        }
Ejemplo n.º 17
0
        public void TestonfirmPwdIvalid1()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            TextBox testTextBox1     = new TextBox();
            TextBox testTextBox2     = new TextBox();

            testTextBox1.Text = "password";
            testTextBox1.Text = "pas$$ord";
            Assert.False(v.ConfirmIsSame(testTextBox1, testTextBox2));
        }
Ejemplo n.º 18
0
        public void TestConfirmPwdInvalid2()
        {
            Books365.BLL.Validator v = new Books365.BLL.Validator();
            PasswordBox            testPasswordBox1 = new PasswordBox();
            PasswordBox            testPasswordBox2 = new PasswordBox();

            testPasswordBox1.Password = "******";
            testPasswordBox2.Password = "******";
            Assert.False(v.ConfirmIsSame(testPasswordBox1, testPasswordBox2));
        }