Esempio n. 1
0
        public IEnumerable<BaseGenre> RebuildGenreTree()
        {
            var autoBiography = new AutoBiographyGenre();
            var memoire = new MemoirGenre();
            var biography = new BiographyGenre();

            var alternateHistory = new AlternateHistoryGenre();
            var periodPiece = new PeriodPieceGenre();
            var costumeDrama = new CostumeDramaGenre();
            var jidaigeki = new JidaigekiGenre();
            var historicalFiction = new HistoricalFictionGenre();

            var historical = new HistoricalGenre();
            var genres = new List<BaseGenre>();

            biography.AddSubGenre(autoBiography);
            biography.AddSubGenre(memoire);
            historicalFiction.AddSubGenre(alternateHistory);
            historicalFiction.AddSubGenre(periodPiece);
            historicalFiction.AddSubGenre(costumeDrama);
            historicalFiction.AddSubGenre(jidaigeki);
            historical.AddSubGenre(biography);
            historical.AddSubGenre(historicalFiction);

            genres.Add(historical);
            return genres;
        }
Esempio n. 2
0
 public void CanUpdateGenre()
 {
     var genre = new BiographyGenre();
     beekRepos.AddGenre(genre);
     genre.Name = "updatedGenre";
     beekRepos.UpdateGenre(genre);
     int cnt = beekRepos.GetGenres().Count();
     Assert.IsTrue(beekRepos.GetGenres().Where(g => g.Name.Equals("updatedGenre")).Count() == cnt);
 }
Esempio n. 3
0
 public void IsGenreDetectsChildGenre()
 {
     BaseBeek beek = new BaseBeek(BeekTypes.ShortStory);
     var biography = new BiographyGenre();
     var autoBiography = new AutoBiographyGenre();
     biography.AddSubGenre(autoBiography);
     beek.AddGenre(autoBiography);
     Assert.IsTrue(beek.IsGenre(biography));
 }
Esempio n. 4
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));
 }