public void AddManager_InvalidSubordinatePositionName_ShouldThrowPositionAlreadyExistsException() { CompanyManager cm = new CompanyManager(new Company("Test")); cm.NewHead("Head"); cm.AddManager("M1", "Head"); Assert.ThrowsException <PositionAlreadyExistsException>(() => cm.AddManager("M1", "Head")); }
public void AddManager_InvalidSupervisorPositionName_ShouldThrowPositionDoesNotExistException() { CompanyManager cm = new CompanyManager(new Company("Test")); cm.NewHead("Head"); Assert.ThrowsException <PositionDoesNotExistException>(() => cm.AddManager("M1", "M2")); }
public void AddManager_ValidData_AddsManagerPosition() { CompanyManager cm = new CompanyManager(new Company("Test")); cm.NewHead("Head"); cm.AddManager("M1", "Head"); }
public void Hire_InvalidPositionName_ShouldThrowPositionDoesNotExistException() { CompanyManager cm = new CompanyManager(new Company("Test")); cm.NewHead("Head"); cm.AddManager("M1", "Head"); Assert.ThrowsException <PositionDoesNotExistException>(() => cm.Hire("Tom", "3200", "W1")); }
public void Hire_InvalidSalary_ShouldThrowArgumentOutOfRangeException() { CompanyManager cm = new CompanyManager(new Company("Test")); cm.NewHead("Head"); cm.AddManager("M1", "Head"); Assert.ThrowsException <ArgumentOutOfRangeException>(() => cm.Hire("Tom", "-3200", "M1")); }
public void Hire_InvalidName_ShouldThrowFormatException() { CompanyManager cm = new CompanyManager(new Company("Test")); cm.NewHead("Head"); cm.AddManager("M1", "Head"); Assert.ThrowsException <FormatException>(() => cm.Hire(".Tom", "3200", "M1")); }
public void Hire_ValidData_AddsEmployee() { CompanyManager cm = new CompanyManager(new Company("Test")); cm.NewHead("Head"); cm.AddManager("M1", "Head"); cm.Hire("Tom", "3200", "M1"); }
public void AddManager_InvalidSupervisorPositionType_ShouldThrowPositionCanNotHaveSubordinatesException() { CompanyManager cm = new CompanyManager(new Company("Test")); cm.NewHead("Head"); cm.AddWorker("W1", "Head"); Assert.ThrowsException <PositionCanNotHaveSubordinatesException>(() => cm.AddManager("M1", "W1")); }
public void ChangeHead_ExistedPositionName_ShouldThrowPositionAlreadyExistsException() { CompanyManager cm = new CompanyManager(new Company("Test")); cm.NewHead("Head"); cm.AddManager("SecondHead", "Head"); Assert.ThrowsException <PositionAlreadyExistsException>(() => cm.ChangeHead("SecondHead")); }
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"); }