예제 #1
0
        public void Frank_Meana_YukonContainsCorrectImages()
        {
            // assign a Yukon instance to the Potato
            potato = new Yukon();

            // test expected images match actual
            Assert.AreEqual(@"/Images/yukon.png", potato.ImageSource(), "Yukon image expected does not match actual");
            Assert.AreEqual(@"/Images/yukon_crossed.png", potato.CrossedImageSource(), "Yukon crossed image expected does not match actual");
        }
예제 #2
0
        public void Frank_Meana_NadineContainsCorrectImages()
        {
            // assign a Nadine instance to the Potato
            potato = new Nadine();

            // test expected images match actual
            Assert.AreEqual(@"/Images/nadine.png", potato.ImageSource(), "Nadine image expected does not match actual");
            Assert.AreEqual(@"/Images/nadine_crossed.png", potato.CrossedImageSource(), "Nadine crossed image expected does not match actual");
        }
예제 #3
0
        public void Frank_Meana_RussetContainsCorrectImages()
        {
            // assign a Russet instance to the Potato
            potato = new Russet();

            // test expected images match actual
            Assert.AreEqual(@"/Images/russet.png", potato.ImageSource(), "Russet image expected does not match actual");
            Assert.AreEqual(@"/Images/russet_crossed.png", potato.CrossedImageSource(), "Russet crossed image expected does not match actual");
        }
예제 #4
0
        public void Frank_Meana_MajestyContainsCorrectImages()
        {
            // assign a Majesty instance to the Potato
            potato = new Majesty();

            // test expected images match actual
            Assert.AreEqual(@"/Images/majesty.png", potato.ImageSource(), "Majesty image expected does not match actual");
            Assert.AreEqual(@"/Images/majesty_crossed.png", potato.CrossedImageSource(), "Majesty crossed image expected does not match actual");
        }
예제 #5
0
        /// <summary>
        /// Displays potato images only in the grid below the first number. The other grid below the second number remains empty. Instead, what occurs is images in the first grid are
        /// crossed out. The number of crossed out images corresponds exactly to the second number which are the amount of potatoes subtracted.
        /// This template for the grids will be used in the case of subtraction
        /// </summary>
        private void DisplayPotatoesSubtracted()
        {
            // Declare an image (to be used for altering the potatoes displayed in the for loop)
            Image image;

            // Display potato images corresponding to the result (which is how many are actually left)
            // iterate for as long as the length of the result, access each image and change its source
            for (int i = 0; i < result; i++)
            {
                image        = firstNumberPotatoGrid.Children[i] as Image;
                image.Source = new BitmapImage(new Uri(randomPotato.ImageSource(), UriKind.Relative));
            }

            // Display the potatoes that are subtracted faded
            // iterate for as long as the length of (FINISH DESCRIBING THIS)
            for (int i = result; i < equation.FirstNumber; i++)
            {
                image = firstNumberPotatoGrid.Children[i] as Image;

                // USE CROSSED OUT IMAGE HERE !!!
                image.Source = new BitmapImage(new Uri(randomPotato.CrossedImageSource(), UriKind.Relative));
            }
        }