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")); }
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")); }
public void AddWorker_InvalidSupervisorPositionName_ShouldThrowPositionDoesNotExistException() { CompanyManager cm = new CompanyManager(new Company("Test")); cm.NewHead("Head"); Assert.ThrowsException <PositionDoesNotExistException>(() => cm.AddWorker("W1", "M1")); }
public void AddWorker_ValidData_AddsWorkerPosition() { CompanyManager cm = new CompanyManager(new Company("Test")); cm.NewHead("Head"); cm.AddWorker("W1", "Head"); }
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"); }