Exemplo n.º 1
0
        public void CustomIcon_UpdateFavoriteIcon_ChangesIconImage()
        {
            var   favorite     = this.UpdateFavoriteIcon();
            Image favoriteIcon = this.Favorites.LoadFavoriteIcon(favorite);

            ImageAssert.EqualsToExpectedIcon(this.TestContext.DeploymentDirectory, favoriteIcon);
        }
Exemplo n.º 2
0
        public void UpdateFavoriteIcon_StoresIconToDatabase()
        {
            IFavorite favorite = this.CreateTestFavorite();

            // try to access on not saved favorite
            this.PrimaryFavorites.Add(favorite);

            this.PrimaryFavorites.UpdateFavoriteIcon(favorite, IMAGE_FILE);
            this.PrimaryFavorites.Update(favorite);
            Image favoriteIcon = this.PrimaryFavorites.LoadFavoriteIcon(favorite);

            DbFavorite checkFavorite = this.CheckFavorites.FirstOrDefault();

            Assert.IsNotNull(favoriteIcon, "Icon wasn't assigned successfully");
            var loadedIcon = this.SecondaryFavorites.LoadFavoriteIcon(checkFavorite);

            Assert.IsNotNull(loadedIcon, "Icon didn't reach the database");
            ImageAssert.EqualsToExpectedIcon(this.TestContext.DeploymentDirectory, favoriteIcon);
        }