Esempio n. 1
0
        // Description - Tests the functionality of bitCollage. Calls every
        //                overridden method.
        static void bitCollageTestSuite(imageCollage bitCollage)
        {
            Console.Write("Calling getDisplay() on bitCollage object 5 times: ");
            Console.WriteLine();
            repeatDisplay(bitCollage);
            Console.WriteLine();

            Console.Write("Testing replaceImage() bitCollage method: ");
            Console.WriteLine();
            Console.Write("Calling getDisplay() to fill an array of images to replace...");
            int[] replace = bitCollage.getDisplay();
            Console.Write("Done.");
            Console.WriteLine();
            foreach (int element in replace)
            {
                Console.Write("Attempting to replace ");
                Console.Write(element);
                Console.Write("...");
                if (bitCollage.replaceImage(element))
                    Console.Write("Success!");
                else
                    Console.Write("Failed!");
                Console.WriteLine();
            }

            Console.WriteLine();
            Console.Write("Calling getDisplay() on bitCollage object 5 more times: ");
            Console.WriteLine();
            repeatDisplay(bitCollage);

            Console.WriteLine();
            Console.Write("getDisplay() has been called ");
            Console.Write(bitCollage.getDisplayCount());
            Console.Write(" times.");
            Console.WriteLine();

            Console.Write(bitCollage.getReplaceCount());
            Console.Write(" images have been replaced.");
            Console.WriteLine();

            Console.WriteLine();
            Console.Write("Calling toggleActive()...");
            bitCollage.toggleActive();
            Console.Write("Done.");
            Console.WriteLine();
            Console.Write("Attempting to display collage: ");
            displayCollage(bitCollage.getDisplay());
            Console.WriteLine();

            Console.Write("Calling toggleActive()...");
            bitCollage.toggleActive();
            Console.Write("Done.");
            Console.WriteLine();
            Console.Write("Attempting to display collage: ");
            Console.WriteLine();
            displayCollage(bitCollage.getDisplay());
            Console.WriteLine();
        }
Esempio n. 2
0
        // Description - Tests the functionality of bitCollage. Calls every
        //                overridden method.
        static void bitCollageTestSuite(imageCollage bitCollage)
        {
            Console.Write("Calling getDisplay() on bitCollage object 5 times: ");
            Console.WriteLine();
            repeatDisplay(bitCollage);
            Console.WriteLine();

            Console.Write("Testing replaceImage() bitCollage method: ");
            Console.WriteLine();
            Console.Write("Calling getDisplay() to fill an array of images to replace...");
            int[] replace = bitCollage.getDisplay();
            Console.Write("Done.");
            Console.WriteLine();
            foreach (int element in replace)
            {
                Console.Write("Attempting to replace ");
                Console.Write(element);
                Console.Write("...");
                if (bitCollage.replaceImage(element))
                {
                    Console.Write("Success!");
                }
                else
                {
                    Console.Write("Failed!");
                }
                Console.WriteLine();
            }

            Console.WriteLine();
            Console.Write("Calling getDisplay() on bitCollage object 5 more times: ");
            Console.WriteLine();
            repeatDisplay(bitCollage);

            Console.WriteLine();
            Console.Write("getDisplay() has been called ");
            Console.Write(bitCollage.getDisplayCount());
            Console.Write(" times.");
            Console.WriteLine();

            Console.Write(bitCollage.getReplaceCount());
            Console.Write(" images have been replaced.");
            Console.WriteLine();

            Console.WriteLine();
            Console.Write("Calling toggleActive()...");
            bitCollage.toggleActive();
            Console.Write("Done.");
            Console.WriteLine();
            Console.Write("Attempting to display collage: ");
            displayCollage(bitCollage.getDisplay());
            Console.WriteLine();

            Console.Write("Calling toggleActive()...");
            bitCollage.toggleActive();
            Console.Write("Done.");
            Console.WriteLine();
            Console.Write("Attempting to display collage: ");
            Console.WriteLine();
            displayCollage(bitCollage.getDisplay());
            Console.WriteLine();
        }
Esempio n. 3
0
        // Description - Tests the functionality of imageCollage. Calls every method in
        //                in imageCollage under different conditions.
        static void imageCollageTestSuite(imageCollage imageCollage)
        {
            Console.Write("Calling getDisplay() on imageCollage object: ");
            Console.WriteLine();
            displayCollage(imageCollage.getDisplay());
            Console.WriteLine();

            Console.WriteLine();
            Console.Write("Testing replaceImage() imageCollage method: "); 
            Console.WriteLine();
            Console.Write("Calling getDisplay() to fill an array of images to replace...");
            int[] replace = imageCollage.getDisplay();
            Console.Write("Done.");
            Console.WriteLine();
            for (int index = 0; index < (TEST_SIZE / COLLAGE_PORTION); ++index)
            {
                Console.Write("Attempting to replace ");
                Console.Write(replace[index]);
                Console.Write("...");
                if (imageCollage.replaceImage(replace[index])) //Each call will succeed because
                    Console.Write("Success!");                 //   each ID is in the object
                else
                    Console.Write("Failed!");
                Console.WriteLine();
            }

            Console.WriteLine();
            Console.Write("Calling getDisplay() on imageCollage object: ");
            Console.WriteLine();
            displayCollage(imageCollage.getDisplay());
            Console.WriteLine();

            Console.WriteLine();
            Console.Write("Testing imgQuery(): ");
            Console.WriteLine();
            Console.Write("Is ");
            Console.Write(replace[TEST_SIZE - 1]);
            Console.Write(" in the collage: ");
            if (imageCollage.imgQuery(replace[TEST_SIZE - 1]))
                Console.Write("Yes!");
            else
                Console.Write("No!");
            Console.WriteLine();
            Console.Write("Is ");
            Console.Write(replace[IMAGE]);
            Console.Write(" in the collage: ");
            if (imageCollage.imgQuery(replace[IMAGE]))
                Console.Write("Yes!");
            else
                Console.Write("No!");
            Console.WriteLine();

            Console.WriteLine();
            Console.Write("getDisplay() has been called ");
            Console.Write(imageCollage.getDisplayCount());
            Console.Write(" times.");
            Console.WriteLine();

            Console.Write(imageCollage.getReplaceCount());
            Console.Write(" images have been replaced.");
            Console.WriteLine();

            Console.WriteLine();
            Console.Write("Calling toggleActive()...");
            imageCollage.toggleActive();
            Console.Write("Done.");
            Console.WriteLine();
            Console.Write("Attempting to replace ");
            Console.Write(replace[TEST_SIZE - 1]); //This call will fail, already replaced above
            Console.Write("...");
            if (imageCollage.replaceImage(replace[TEST_SIZE - 1]))
                Console.Write("Success!");
            else
                Console.Write("Failed!");
            Console.WriteLine();
            Console.Write("Attempting to display collage: ");
            displayCollage(imageCollage.getDisplay());
            Console.WriteLine();

            Console.Write("Calling toggleActive()...");
            imageCollage.toggleActive();
            Console.Write("Done.");
            Console.WriteLine();
            Console.Write("Attempting to replace ");
            Console.Write(replace[TEST_SIZE - 1]);
            Console.Write("...");
            if (imageCollage.replaceImage(replace[TEST_SIZE - 1]))
                Console.Write("Success!");
            else
                Console.Write("Failed!");
            Console.WriteLine();
            Console.Write("Attempting to display collage: ");
            Console.WriteLine();
            displayCollage(imageCollage.getDisplay());
            Console.WriteLine();


        }
Esempio n. 4
0
        // Description - Tests the functionality of imageCollage. Calls every method in
        //                in imageCollage under different conditions.
        static void imageCollageTestSuite(imageCollage imageCollage)
        {
            Console.Write("Calling getDisplay() on imageCollage object: ");
            Console.WriteLine();
            displayCollage(imageCollage.getDisplay());
            Console.WriteLine();

            Console.WriteLine();
            Console.Write("Testing replaceImage() imageCollage method: ");
            Console.WriteLine();
            Console.Write("Calling getDisplay() to fill an array of images to replace...");
            int[] replace = imageCollage.getDisplay();
            Console.Write("Done.");
            Console.WriteLine();
            for (int index = 0; index < (TEST_SIZE / COLLAGE_PORTION); ++index)
            {
                Console.Write("Attempting to replace ");
                Console.Write(replace[index]);
                Console.Write("...");
                if (imageCollage.replaceImage(replace[index])) //Each call will succeed because
                {
                    Console.Write("Success!");                 //   each ID is in the object
                }
                else
                {
                    Console.Write("Failed!");
                }
                Console.WriteLine();
            }

            Console.WriteLine();
            Console.Write("Calling getDisplay() on imageCollage object: ");
            Console.WriteLine();
            displayCollage(imageCollage.getDisplay());
            Console.WriteLine();

            Console.WriteLine();
            Console.Write("Testing imgQuery(): ");
            Console.WriteLine();
            Console.Write("Is ");
            Console.Write(replace[TEST_SIZE - 1]);
            Console.Write(" in the collage: ");
            if (imageCollage.imgQuery(replace[TEST_SIZE - 1]))
            {
                Console.Write("Yes!");
            }
            else
            {
                Console.Write("No!");
            }
            Console.WriteLine();
            Console.Write("Is ");
            Console.Write(replace[IMAGE]);
            Console.Write(" in the collage: ");
            if (imageCollage.imgQuery(replace[IMAGE]))
            {
                Console.Write("Yes!");
            }
            else
            {
                Console.Write("No!");
            }
            Console.WriteLine();

            Console.WriteLine();
            Console.Write("getDisplay() has been called ");
            Console.Write(imageCollage.getDisplayCount());
            Console.Write(" times.");
            Console.WriteLine();

            Console.Write(imageCollage.getReplaceCount());
            Console.Write(" images have been replaced.");
            Console.WriteLine();

            Console.WriteLine();
            Console.Write("Calling toggleActive()...");
            imageCollage.toggleActive();
            Console.Write("Done.");
            Console.WriteLine();
            Console.Write("Attempting to replace ");
            Console.Write(replace[TEST_SIZE - 1]); //This call will fail, already replaced above
            Console.Write("...");
            if (imageCollage.replaceImage(replace[TEST_SIZE - 1]))
            {
                Console.Write("Success!");
            }
            else
            {
                Console.Write("Failed!");
            }
            Console.WriteLine();
            Console.Write("Attempting to display collage: ");
            displayCollage(imageCollage.getDisplay());
            Console.WriteLine();

            Console.Write("Calling toggleActive()...");
            imageCollage.toggleActive();
            Console.Write("Done.");
            Console.WriteLine();
            Console.Write("Attempting to replace ");
            Console.Write(replace[TEST_SIZE - 1]);
            Console.Write("...");
            if (imageCollage.replaceImage(replace[TEST_SIZE - 1]))
            {
                Console.Write("Success!");
            }
            else
            {
                Console.Write("Failed!");
            }
            Console.WriteLine();
            Console.Write("Attempting to display collage: ");
            Console.WriteLine();
            displayCollage(imageCollage.getDisplay());
            Console.WriteLine();
        }