Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 3
0
 public void CantAddParentGenreAsSubGenre()
 {
     FantasyGenre fantasy = new FantasyGenre();
     HistoricalFictionGenre history = new HistoricalFictionGenre();
     history.AddSubGenre(fantasy);
     fantasy.AddSubGenre(history);
 }
Ejemplo n.º 4
0
 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));
 }
Ejemplo n.º 5
0
 public void CantAddGenreToItself()
 {
     FantasyGenre genre = new FantasyGenre();
     genre.AddSubGenre(genre);
 }