public void Adding_Developer_Should_Not_Throw_Exception_In_ActiveState() { // Arrange Project project = new Project("Test Project", new Person("Bas", ERole.Lead)); SprintFactory factory = new SprintFactory(); Person p1 = new Person("Tom", ERole.Developer); Person p2 = new Person("Jan Peter", ERole.Tester); Person p3 = new Person("Dick Bruna", ERole.Developer); ISprint sprint = factory.MakeReleaseSprint("Sprint 1", DateTime.Parse("2010-10-10T00:00:00Z"), DateTime.Parse("2010-10-10T00:00:00Z").AddDays(14), project, p1, new List <Person>() { p2 }); project.AddSprint(sprint); sprint.GetState().ToNextState(); // Act sprint.GetState().AddDeveloper(p3); // Assert Assert.Contains(p3, sprint.GetDevelopers()); }
public void Adding_Developer_Should_Throw_NotSupportedException_In_FinishedState() { // Arrange Project project = new Project("Test Project", new Person("Bas", ERole.Lead)); SprintFactory factory = new SprintFactory(); Person p1 = new Person("Tom", ERole.Developer); Person p2 = new Person("Jan Peter", ERole.Tester); Person p3 = new Person("Dick Bruna", ERole.Developer); ISprint sprint = factory.MakeReviewSprint("Sprint 1", DateTime.Parse("2010-10-10T00:00:00Z"), DateTime.Parse("2010-10-10T00:00:00Z").AddDays(14), project, p1, new List <Person>() { p2 }); project.AddSprint(sprint); sprint.GetState().ToNextState(); sprint.GetState().ToNextState(); // Act // Assert Assert.Throws <NotSupportedException>(() => project.GetSprints().First().GetState().AddDeveloper(p3)); Assert.DoesNotContain(p3, sprint.GetDevelopers()); }