Beispiel #1
0
        public void EmployeeGridList_Has_Data()
        {
            IVitalsView   view = new MockVitalsView();
            IEmployeeData data = new MockEmployeeData();

            var presenter = new VitalsPresenter(view, data);

            Assert.IsTrue(presenter.GetEmployeeGridList().Count > 0);
        }
Beispiel #2
0
        public void Initialize_View()
        {
            var           view      = new MockVitalsView();
            IEmployeeData data      = new MockEmployeeData();
            var           presenter = new VitalsPresenter(view, data);

            presenter.Initialize();

            Assert.Greater(presenter.GetEmployeeGridList().Count, 1);
        }
Beispiel #3
0
        public void Display_No_Message_When_User_Is_Selected_In_Dropdown()
        {
            var           view      = new MockVitalsView();
            IEmployeeData data      = new MockEmployeeData();
            var           presenter = new VitalsPresenter(view, data);

            view.EmployeeId = "1";
            presenter.RefreshGridView();

            Assert.AreEqual(view.ErrorMessage, string.Empty);
        }
Beispiel #4
0
        public void Username_Returned_Is_CSmith()
        {
            IHeaderView   view = new MockHeaderView();
            IEmployeeData data = new MockEmployeeData();

            var presenter = new HeaderPresenter(view, data);
            var userInfo  = data.GetEmployeeListById(2);

            foreach (var item in userInfo)
            {
                view.Username = item.Username;
            }

            Assert.AreEqual("CSmith", view.Username);
        }
Beispiel #5
0
        public void Search_EmployeeList_By_Id_Returns_Charles_Smith()
        {
            IVitalsView   view = new MockVitalsView();
            IEmployeeData data = new MockEmployeeData();

            var presenter = new VitalsPresenter(view, data);

            List <Employee> emp = presenter.GetEmployeeGridListById(2);

            string fullName = string.Empty;

            foreach (var item in emp)
            {
                fullName = item.FullName;
            }

            Assert.AreEqual("Smith, Charles", fullName);
        }