예제 #1
0
        private void AdminBtn_Click(object sender, EventArgs e)
        {
            try
            {
                var myLogin = EntryController.GetLogIn("Administrator");

                myLogin.Show();

                this.Hide();
            }
            catch (Exception)
            {
                MessageBox.Show("Log in Error, please try later");
            }
        }
예제 #2
0
        public void GetLogInTest()
        {
            //Arrange
            var userType = "Administrator";

            var Admin = new Administrator();

            var expectedResult = new LogInView(Admin);// Expected result is the loginview for an Admin

            //Act
            var result = EntryController.GetLogIn(userType); // testing the method that replace the login view with admin login view

            //Assert
            Assert.AreEqual(expectedResult.MyUser.GetType().Name, result.MyUser.GetType().Name);  // checking if both are the same type of loginView
        }