private static void TestWorkers() { AbstractWorker WA = new WorkerA(); AbstractWorker WB = new WorkerB(); WA.Work(); WB.Work(); }
public void GetByWage_IncorectParameter_ThrowsArgException(double wage) { var company = new Company(); var emp = new WorkerA("John", 4000); company.AddEmployee(emp); Action act = () => company.GetByWage(wage); act.Should().Throw <ArgumentException>(); }
public void AddEmployee_SameInstanceTwice_ThrowsException() { var company = new Company(); var emp = new WorkerA("John", 4000); company.AddEmployee(emp); Action act = () => company.AddEmployee(emp); act.Should().Throw <Exception>(); }
public void AddEmployees_ListWithNull_ThrowsExceptionWithInnerException() { var company = new Company(); var employee = new WorkerA("Joni", 3000); var employees = new List <Employee> { employee, employee }; Action act = () => company.AddEmployees(employees); act.Should().Throw <Exception>() .WithInnerException <Exception>(); }
public void Visit(WorkerA workerA) { _subordinates.Clear(); }