Exemple #1
0
        public void BeforeTest()
        {
            MainViewModel.OpenDbConnection = false;
            Assert.IsFalse(MainViewModel.OpenDbConnection); //Making sure that the Database API connection is closed during unit testing.

            _mainViewModel   = new MainViewModel();
            _employeeHandler = new EmployeeHandler(_mainViewModel);

            _testEmployee = new StandardEmp()
            {
                EmployeeId = 22, Name = "TestEmployee", SickDays = 0, VacationDays = 0, Manager = "NotAdminTestEmployee", SalaryNumber = 1
            };
            _testEmployee2 = new StandardEmp()
            {
                EmployeeId = 50, Name = "TestEmployee2"
            };
            _testAdminEmp = new AdminEmp()
            {
                EmployeeId = 75, Name = "AdminTestEmployee", AdminLvl = 1
            };
            _testAdminEmp2 = new AdminEmp()
            {
                EmployeeId = 15, AdminLvl = 2, Name = "AdminLvl2TestEmployee"
            };



            _mainViewModel.EmployeesInDb.Add(_testEmployee);
            _mainViewModel.EmployeesInDb.Add(_testEmployee2);

            _mainViewModel.EmployeesInDb.Add(_testAdminEmp);
            _mainViewModel.EmployeesInDb.Add(_testAdminEmp2);

            _mainViewModel.LoggedInEmployees.Add(_testEmployee2);
        }
Exemple #2
0
        public void TestMethod4()
        {
            //Testcase 1.4
            _mainViewModel.LoginOrLogoutBox = "50";
            Assert.AreEqual("50", _mainViewModel.LoginOrLogoutBox);

            _employeeHandler.LoginOrLogout();
            _mainViewModel.LoggedInEmployees.Clear(); //Simulates the removal of the employee from the logged in table using the DeleteDataLoggedIn() method.


            Assert.IsFalse(_mainViewModel.LoggedInEmployees.Contains(_testEmployee2));
        }
Exemple #3
0
 public void IsInitiated_returns_false()
 {
     Assert.IsFalse(Sut.IsInitiated());
 }