public void CantHireAgentEmployedBySomeoneElse() { var state = new AgentState(); var agent = Agent.Builder.Build(state).Build(new TestIdResolver()); var c1 = new Corporation(); c1.Hire(agent); var c2 = new Corporation(); Should.Throw<ArgumentException>(() => c2.Hire(agent)); }
public void CanBeHired() { var state = new AgentState(); var agent = Agent.Builder.Build(state).Build(new TestIdResolver()); var corporation = new Corporation(); corporation.Hire(agent); agent.Corporation.ShouldBe(corporation); corporation.Employees.ShouldContain(agent); }