public void AssignAlreadyAssignedTaskShouldFail() { // Arrange var task = new TaskMother().Build(); var teamMember = new TeamMemberMother().Build(); var expectedCount = 1; // Act try { task.Assign(teamMember); task.Assign(teamMember); } catch (Exception) { var actual = task.GetAssignedMembers().Count(); Assert.AreEqual(expectedCount, actual); throw; } }
public void AssignTaskTest() { // Arrange var task = new TaskMother().Build(); var teamMember = new TeamMemberMother().Build(); var originalCount = task.GetAssignedMembers().Count(); var expectedCount = 1; // Act task.Assign(teamMember); var actualCount = task.GetAssignedMembers().Count(); var actualId = task.GetAssignedMember(teamMember.Id).Id; // Assert Assert.AreEqual(teamMember.Id, actualId); Assert.AreEqual(expectedCount, actualCount); Assert.AreNotEqual(originalCount, actualCount); }