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 }));
        }
Example #2
0
        public void WillNotErrorWhenEmailStringIsNull()
        {
            // arrange
            var model = new InviteTeamMembersViewModel();

            model.InvitedEmails = null;

            // act
            var result = model.GetParsedInvitedEmails;

            // assert
            Assert.Equal(0, result.Count);
        }
Example #3
0
        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]);
        }