protected override void SharedContext()
            {
                employee = new Employee("First Name", "Last Name", "*****@*****.**");
                manager = new Employee("First Name", "Last Name", "*****@*****.**");
                managerList = new List<Employee> { manager };

                view = MockRepository.GenerateMock<ISelectEmployeeManagerView>();

                employeeRepository = MockRepository.GenerateMock<IEmployeeRepository>();
                employeeRepository.Stub(r => r.GetManagerList()).Return(managerList);
            }
        public Employee GetManagerFor(Employee employee)
        {
            IList<Employee> managerList = EmployeeRepository.GetManagerList();
            View.ShowListOfManagers(managerList);

            View.ShowEmployee(employee);

            View.Run();

            return SelectedManager;
        }
            protected override void SharedContext()
            {
                view = MockRepository.GenerateMock<IOrgChartView>();
                bob = new Employee("Bob", "Jones", "*****@*****.**");
                employeeList = new List<Employee>{bob};

                appController = MockRepository.GenerateMock<IApplicationController>();

                employeeRepo = MockRepository.GenerateMock<IEmployeeRepository>();
                employeeRepo.Stub(r => r.GetEmployeeOrgChart()).Return(employeeList);
            }
            protected override void SharedContext()
            {
                employeeInfo = new EmployeeInfo { FirstName = "Jim", LastName = "Jones", Email = "*****@*****.**" };
                getNewEmployeeInfo = MockRepository.GenerateMock<IGetNewEmployeeInfo>();

                Employee newEmployee = new Employee("Bob", "Jones", "*****@*****.**");
                getEmployeeManager = MockRepository.GenerateMock<IGetEmployeeManager>();
                getEmployeeManager.Stub(g => g.GetManagerFor(null)).IgnoreArguments().Return(newEmployee);

                appController = MockRepository.GenerateMock<IApplicationController>();
            }
 private IList<Employee> GetSubEmployees(Employee manager)
 {
     IList<Employee> flattenedList = new List<Employee>();
     foreach (Employee employee in manager.Employees)
     {
         flattenedList.Add(employee);
         IList<Employee> subEmployees = GetSubEmployees(employee);
         foreach(Employee subEmployee in subEmployees)
             flattenedList.Add(subEmployee);
     }
     return flattenedList;
 }
		private IList<TreeNode> GetChildren(Employee employee)
		{
			IList<TreeNode> nodes = new List<TreeNode>();
			foreach (Employee child in employee.Employees)
			{
				TreeNode node = GetNode(child);
				IList<TreeNode> children = GetChildren(child);
				foreach (TreeNode childNode in children)
					node.Nodes.Add(childNode);
				nodes.Add(node);
			}
			return nodes;
		}
 public EmployeeSelectedEvent(Employee employee)
 {
     Employee = employee;
 }
 public void ShowEmployee(Employee employee)
 {
     Employee.Text = employee.DisplayName;
 }
 protected override void SharedContext()
 {
     bob = new Employee("Bob", "Jones", "*****@*****.**");
     view = MockRepository.GenerateMock<IEmployeeDetailView>();
 }
 public void ManagerSelected(Employee manager)
 {
     SelectedManager = manager;
 }
Example #11
0
		private TreeNode GetNode(Employee employee)
		{
			TreeNode node = new TreeNode(employee.DisplayName);
			node.Tag = employee;
			return node;
		}