public void CanAddGenreExactlyOnce() { BaseBeek beek = new BaseBeek(BeekTypes.ShortStory); FantasyGenre fantasy = new FantasyGenre(); beek.AddGenre(fantasy); Assert.IsTrue(beek.Genres.Where(g => g.Equals(fantasy)).Count() == 1); // Should be ignored as it is already added beek.AddGenre(fantasy); Assert.IsTrue(beek.Genres.Where(g => g.Equals(fantasy)).Count() == 1); }
public void IsParentWorksThroughEntireBranch() { HistoricalFictionGenre history = new HistoricalFictionGenre(); FantasyGenre fantasy = new FantasyGenre(); CostumeDramaGenre costume = new CostumeDramaGenre(); history.AddSubGenre(fantasy); fantasy.AddSubGenre(costume); Assert.IsTrue(history.IsParentOf(costume)); }
public void CantAddParentGenreAsSubGenre() { FantasyGenre fantasy = new FantasyGenre(); HistoricalFictionGenre history = new HistoricalFictionGenre(); history.AddSubGenre(fantasy); fantasy.AddSubGenre(history); }
public void IsChildWorksThroughEntireTree() { HistoricalFictionGenre history = new HistoricalFictionGenre(); FantasyGenre fantasy = new FantasyGenre(); CostumeDramaGenre costume = new CostumeDramaGenre(); history.AddSubGenre(fantasy); fantasy.AddSubGenre(costume); Assert.IsTrue(costume.IsChildOf(history)); }
public void CantAddGenreToItself() { FantasyGenre genre = new FantasyGenre(); genre.AddSubGenre(genre); }