Esempio n. 1
0
 private void nextButton_Click(object sender, EventArgs e)
 {
     if (manager.CanMoveNext)
     {
         manager.MoveNext();
         DisplayCurrentArtwork();
     }
 }
Esempio n. 2
0
        public void Length_Property_Matches_Entries()
        {
            var manager = new ArtworkManager();

            manager.MoveFirst();
            var length = manager.Length;

            for (int i = 0; i < length; i++)
            {
                //last run cant move foreward
                if (i == length - 1)
                {
                    Assert.IsFalse(manager.CanMoveNext);
                }

                manager.MoveNext();
            }
            //Assert.Fail();
        }
Esempio n. 3
0
        private static bool ValidArtworksContainedTest(ArtworkManager manager, string testStr)
        {
            manager.MoveFirst();
            var artwork = manager.CurrentArtwork;
            var length  = manager.Length;

            for (int i = 0; i < length; i++)
            {
                if (artwork.Description.ToLower().Contains(testStr.ToLower()) == false)
                {
                    return(false);
                }

                if (manager.CanMoveNext)
                {
                    manager.MoveNext();
                    artwork = manager.CurrentArtwork;
                }
            }

            return(true);
        }