Exemple #1
0
        public void Managers_Current_Is_First_Of_Collection()
        {
            var manager      = new ArtworkManager();
            var currentStart = manager.CurrentArtwork;

            manager.MoveFirst();
            var fist = manager.CurrentArtwork;

            Assert.AreEqual(currentStart, fist);
        }
Exemple #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();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            backButton = FindViewById <Button>(Resource.Id.buttonBack);
            nextButton = FindViewById <Button>(Resource.Id.buttonNext);
            textTitle  = FindViewById <TextView>(Resource.Id.textTitle);
            textDesc   = FindViewById <TextView>(Resource.Id.textDesc);
            image      = FindViewById <ImageView>(Resource.Id.imageView);

            backButton.Click += backButton_Click;
            nextButton.Click += nextButton_Click;

            manager = new ArtworkManager();
            manager.MoveFirst();
            DisplayCurrentArtwork();
        }
Exemple #4
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);
        }
Exemple #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.ArtworkActivity);

            _artworkCategoryManager = new ArtworkCategoryManager();
            _artworkCategoryManager.MoveFirst();

            var categoryTitle = _artworkCategoryManager.Current.Title;

            _artworkManager = new ArtworkManager(categoryTitle);
            _artworkManager.MoveFirst();
            artworkPagerAdapter = new ArtworkPagerAdapter(SupportFragmentManager, _artworkManager);
            viewPager           = FindViewById <ViewPager>(Resource.Id.artworkPager);
            viewPager.Adapter   = artworkPagerAdapter;

            drawerLayout           = FindViewById <DrawerLayout>(Resource.Id.drawerLayout);
            categoryDrawerListView = FindViewById <ListView>(Resource.Id.categoryDrawerListView);

            categoryDrawerListView.Adapter = new ArtworkCategoryManagerAdapter(this, Resource.Layout.CategoryItem, _artworkCategoryManager);
            categoryDrawerListView.SetItemChecked(0, true);

            categoryDrawerListView.ItemClick += categoryDrawerListView_ItemClicked;
        }