Example #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);
 }
Example #2
0
 public void IsGenreDetectsGenre()
 {
     BaseBeek beek = new BaseBeek(BeekTypes.ShortStory);
     var autoBiography = new AutoBiographyGenre();
     beek.AddGenre(autoBiography);
     Assert.IsTrue(beek.IsGenre(autoBiography));
 }
Example #3
0
 public void CanRemoveGenre()
 {
     BaseBeek beek = new BaseBeek(BeekTypes.ShortStory);
     var biography = new BiographyGenre();
     var autoBiography = new AutoBiographyGenre();
     biography.AddSubGenre(autoBiography);
     beek.AddGenre(autoBiography);
     Assert.IsTrue(beek.IsGenre(autoBiography));
     beek.RemoveGenre(autoBiography);
     Assert.IsFalse(beek.IsGenre(autoBiography));
 }