public void should_accept_any_content() { var section = new BasicSection(1, "name"); section.AddContent(new ContentElement(-1, Language.Invariant, ContentType.Text)); section.GetContent().Count().Should().Be(1); }
async Task <int> IPlaylistSongMainLogic.ChooseSongsAsync(IPlayListDetail detail, int percentage, int howmanySongs) { if (_ras == null) { throw new BasicBlankException("Never created the random function before choosing songs. Rethink"); } BasicSection section = new BasicSection() { Percent = percentage, HowManySongs = howmanySongs }; P data = await fs.DeserializeObjectAsync <P>(detail.JsonData); ISongListCreater query = Resolve <ISongListCreater>(); CustomBasicList <ICondition> firstList = query.GetMusicList(data); section.SongList = _data.GetCompleteSongList(firstList); if (section.SongList.Count() == 0) { throw new BasicBlankException("I know this play list has more than 0 songs"); } await _ras.AddSectionAsync(section); //problem is here int sofar = _ras.SongsSoFar(); if (sofar == 0) { throw new BasicBlankException("Can't actually choose 0 songs"); } return(sofar); //hopefully works. }
public void should_require_name() { var section = new BasicSection(1, "name"); section.Name.Should().Be("name"); }
public void should_require_id() { var section = new BasicSection(1, "name"); section.SectionId.Should().Be(1); }