Beispiel #1
0
        public void ShouldAbleToAddAndRetrieveUntilEnd()
        {
            var animeCollection = new AnimeCollection();
            var conan           = new Anime {
                Name = "Detective Conan"
            };
            var naruto = new Anime {
                Name = "Naruto"
            };
            var onepiece = new Anime {
                Name = "One Piece"
            };

            animeCollection.Add(conan);
            animeCollection.Add(naruto);
            animeCollection.Add(onepiece);

            var iterator = animeCollection.CreateIterator();

            for (var anime = iterator.First(); !iterator.IsLast; anime = iterator.Next())
            {
                Console.WriteLine(anime.Name);
            }

            Assert.AreEqual(iterator.Current.Name, onepiece.Name);
        }
Beispiel #2
0
 public MainPage()
 {
     InitializeComponent();
     Collection            = new AnimeCollection();
     AnimeList.ItemsSource = Collection;
 }
Beispiel #3
0
 public AnimeIterator(AnimeCollection collection)
 {
     _collection = collection;
 }