コード例 #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 in the grid below the equation's numbers. The amount of potatoes in both grids matches exacty the number in the equation above it.
        /// This template for the grid images will be used in the case of addition
        /// </summary>
        private void DisplayPotatoesAdded()
        {
            // Declare an image (to be used for altering the potatoes displayed in the for loop)
            Image image;

            // Display potato images corresponding to first number
            // iterate for as long as the length of the first number, access each image and change its source
            for (int i = 0; i < equation.FirstNumber; i++)
            {
                image        = firstNumberPotatoGrid.Children[i] as Image;
                image.Source = new BitmapImage(new Uri(randomPotato.ImageSource(), UriKind.Relative));
            }

            // Display potato images corresponding to second number
            // iterate for as long as the length of the second number, access each image and change its source
            for (int i = 0; i < equation.SecondNumber; i++)
            {
                image        = secondNumberPotatoGrid.Children[i] as Image;
                image.Source = new BitmapImage(new Uri(randomPotato.ImageSource(), UriKind.Relative));
            }
        }