public Model.Party AddSongToParty(int partyId, string songId) { var party = FakePartyDb.GetParty(partyId); party.SongList.Add(songId); hostService.SendMessage(party.HostId, $"add:{songId}"); return(party); }
public Model.Party CreateParty(string name) { var party = new Model.Party() { Name = name, HostId = -1, SongList = new List <string>() }; return(FakePartyDb.CreateParty(party)); }
public void CanCreateParty() { FakePartyDb.Reset(); var partyService = new PartyService(); var createdParty = partyService.CreateParty("test"); var party = partyService.GetParty(createdParty.Id); Assert.AreEqual(-1, party.HostId); Assert.AreEqual("test", party.Name); }
public void CanAddSongToParty() { FakePartyDb.Reset(); var partyService = new PartyService(); var createdParty = partyService.CreateParty("test"); partyService.AddSongToParty(createdParty.Id, "abc"); partyService.AddSongToParty(createdParty.Id, "def"); partyService.AddSongToParty(createdParty.Id, "hij"); var party = partyService.GetParty(createdParty.Id); Assert.AreEqual("abc", party.SongList[0]); Assert.AreEqual("def", party.SongList[1]); Assert.AreEqual("hij", party.SongList[2]); }
public IHttpActionResult Register(string hostId, string partyId) { hostService.Register(int.Parse(hostId), int.Parse(partyId)); FakePartyDb.UpdatePartyHost(int.Parse(hostId), int.Parse(partyId)); return(Ok()); }
public IList <Model.Party> GetAllParties() { return(FakePartyDb.GetAllParties()); }
public Model.Party GetParty(int partyId) { return(FakePartyDb.GetParty(partyId)); }
public Model.Party DeleteSongFromParty(int partyId, string songId) { return(FakePartyDb.DeleteSongFromParty(partyId, songId)); }