public async Task <string> Handle(CreateTeamCommand request, CancellationToken cancellationToken) { var adminMember = new MemberEntity(_currentUserService.UserId, true); var team = TeamAggregate.CreateNew(await _teamRepository.NextIdAsync(), request.Name, adminMember); await _teamRepository.SetAsync(team); return(team.Id.ToString()); }
public void create_team_without_admin_should_throw() { Assert.Throws <DomainException>(() => { TeamAggregate.CreateNew(_teamId, _teamName, GetCommonMember()); }); }