示例#1
0
        public void AddWorker_InvalidSupervisorPositionType_ShouldThrowPositionCanNotHaveSubordinatesException()
        {
            CompanyManager cm = new CompanyManager(new Company("Test"));

            cm.NewHead("Head");
            cm.AddWorker("W1", "Head");
            Assert.ThrowsException <PositionCanNotHaveSubordinatesException>(() => cm.AddWorker("W2", "W1"));
        }
示例#2
0
        public void AddWorker_InvalidSubordinatePositionName_ShouldThrowPositionAlreadyExistsException()
        {
            CompanyManager cm = new CompanyManager(new Company("Test"));

            cm.NewHead("Head");
            cm.AddWorker("W1", "Head");
            Assert.ThrowsException <PositionAlreadyExistsException>(() => cm.AddWorker("W1", "Head"));
        }
示例#3
0
        public void AddWorker_InvalidSupervisorPositionName_ShouldThrowPositionDoesNotExistException()
        {
            CompanyManager cm = new CompanyManager(new Company("Test"));

            cm.NewHead("Head");
            Assert.ThrowsException <PositionDoesNotExistException>(() => cm.AddWorker("W1", "M1"));
        }
示例#4
0
        public void AddWorker_ValidData_AddsWorkerPosition()
        {
            CompanyManager cm = new CompanyManager(new Company("Test"));

            cm.NewHead("Head");
            cm.AddWorker("W1", "Head");
        }
示例#5
0
        public void Appoint_ValidData_ChangesEmployeesPosition()
        {
            CompanyManager cm = new CompanyManager(new Company("Test"));

            cm.NewHead("Head");
            cm.AddManager("M1", "Head");
            cm.AddWorker("W1", "M1");
            cm.Hire("Tom", "3200", "W1");
            cm.Appoint("0", "M1");
        }