Exemplo n.º 1
0
        public async Task <string> StartPartyAsync()
        {
            Party party = new Party(await _partyGoerService.GetCurrentPartyGoerAsync());

            _partyRepository.CreateParty(party);

            return(party.GetPartyCode());
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
 /// <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);
     }
 }