public void CanAddDevsToList() { //Arrange Arrange(); var dev2 = new Developer(2, "Doe", false); var dev3 = new Developer(3, "A", true); var team = new Team(); //Act team.AddDeveloper(_dev1); team.AddDeveloper(dev2); team.AddDeveloper(dev3); var expected = new List <Developer>(); expected.Add(_dev1); expected.Add(dev2); expected.Add(dev3); int expectedCount = expected.Count; var actualCount = team.GetListCount(); //Assert Assert.AreEqual(expectedCount, actualCount); }
public Response CreateTeam(string request) { Response response = new Response(); try { string teamName = Utils.GetTeamName(request); List <Developer> developers = Utils.GetDevelopers(request); Team team = new Team(teamName); foreach (Developer dev in developers) { team.AddDeveloper(dev); } storage.SaveTeam(team); response.Success = true; response.ResponseCode = 200; response.ErrororSuccessMessage = "Successfully Saved"; } catch (Exception ex) { response.Success = false; response.ResponseCode = 500; response.ErrororSuccessMessage = ex.Message; } return(response); }
public void AddingDeveloperToList_ShouldSucceed() { //Arrange Arrange(); var team = new Team(); //Act team.AddDeveloper(_developer); var expectedCount = 1; var actualCount = team.GetListCount(); //Assert Assert.AreEqual(expectedCount, actualCount); }