public ActionResult InviteMembers(InviteTeamMembersViewModel model) { if (!ModelState.IsValid) { return(View(model)); } _teamService.AddMembersByEmail(_currentUserId, model.TeamId, model.GetParsedInvitedEmails); return(RedirectToAction(nameof(Summary), new { id = model.TeamId })); }
public void WillNotErrorWhenEmailStringIsNull() { // arrange var model = new InviteTeamMembersViewModel(); model.InvitedEmails = null; // act var result = model.GetParsedInvitedEmails; // assert Assert.Equal(0, result.Count); }
public void GetParsedInvitedEmails() { // arrange var model = new InviteTeamMembersViewModel(); model.InvitedEmails = "email1 email2"; // act var results = model.GetParsedInvitedEmails; // assert Assert.Equal(2, results.Count); Assert.Equal("email1", results[0]); Assert.Equal("email2", results[1]); }