public async Task <string> StartPartyAsync() { Party party = new Party(await _partyGoerService.GetCurrentPartyGoerAsync()); _partyRepository.CreateParty(party); return(party.GetPartyCode()); }
public void CannotCreateTwoPartiesWithSameCode_ThrowsException() { PartyGoer partyGoer = new PartyGoer(PARTIER_NAME, EXPLICIT, MARKET, PRODUCT); Party party = new Party(partyGoer); PartyRepository.CreateParty(party); Assert.Throws <Exception>(() => PartyRepository.CreateParty(party)); }
public async Task <string> StartPartyWithSeedSongsAsync(List <string> seedTrackUris, PartyGoer host) { Party newParty = new Party(host); List <Song> playlistSongs = await _spotifyHttpClient.GetRecommendedSongsAsync(host.Id, seedTrackUris, 0); newParty.Playlist = new Playlist(playlistSongs, newParty.Listeners, newParty.PartyCode); _partyRepository.CreateParty(newParty); await newParty.Playlist.StartAsync(); return(newParty.PartyCode); }
public async Task <DougResponse> SendInvite(User target, User host, string channel) { var party = _partyRepository.GetPartyByUser(host.Id) ?? _partyRepository.CreateParty(host); if (party.Users.Count >= 3) { return(new DougResponse(DougMessages.PartyFullInvite)); } await ShowInvite(party, target, channel); return(new DougResponse(DougMessages.InviteSent)); }
private void AddToWaitListButton_OnClicked(object sender, EventArgs e) { _myParty = new Party { Name = GroupNameEntry.Text, PartySize = (short)(PartySizePicker.SelectedIndex + 1), WaitMinutes = 15 }; _partyRepository.CreateParty(_myParty); RefreshParties(); AddToSeatingListFrame.IsVisible = false; ThanksFrame.IsVisible = true; }
/// <summary> /// It create a new Party /// </summary> /// <param name="createPartyRequest">Party Name</param> /// <returns>If Party is created Successfully it return Party response model else null</returns> public CreatePartyResponseModel CreateParty(CreatePartyRequestModel createPartyRequest) { try { if (createPartyRequest == null) { return(null); } else { return(_partyRepository.CreateParty(createPartyRequest)); } } catch (Exception e) { throw new Exception(e.Message); } }