Ejemplo n.º 1
0
        public void WrongTypesTest()
        {
            GraphicsRepository <Color, Bitmap> graphics = new GraphicsRepository <Color, Bitmap>();
            bool exceptionThrown = false;

            try
            {
                var bgColor = graphics.GetBackgroundColor();
            }
            catch
            {
                exceptionThrown = true;
            }
            Assert.IsTrue(exceptionThrown);
            exceptionThrown = false;
            try
            {
                var bgColor = graphics.CreateGraphicsObject(10, 10);
            }
            catch
            {
                exceptionThrown = true;
            }
            Assert.IsTrue(exceptionThrown);
            exceptionThrown = false;
            try
            {
                var bgColor = graphics.ColorFromArgb(10, 10, 10, 10);
            }
            catch
            {
                exceptionThrown = true;
            }
            Assert.IsTrue(exceptionThrown);
            exceptionThrown = false;
            try
            {
                var bgColor = graphics.ColorA(new Bitmap(10, 10));
            }
            catch
            {
                exceptionThrown = true;
            }
            Assert.IsTrue(exceptionThrown);
            exceptionThrown = false;
            try
            {
                var bgColor = graphics.ColorB(new Bitmap(10, 10));
            }
            catch
            {
                exceptionThrown = true;
            }
            Assert.IsTrue(exceptionThrown);
            exceptionThrown = false;
            try
            {
                var bgColor = graphics.ColorR(new Bitmap(10, 10));
            }
            catch
            {
                exceptionThrown = true;
            }
            Assert.IsTrue(exceptionThrown);
            exceptionThrown = false;
            try
            {
                var bgColor = graphics.ColorG(new Bitmap(10, 10));
            }
            catch
            {
                exceptionThrown = true;
            }
            Assert.IsTrue(exceptionThrown);
        }
Ejemplo n.º 2
0
 public void GetBackgroundColorTest()
 {
     GraphicsRepository <Bitmap, Color> graphics = new GraphicsRepository <Bitmap, Color>();
     Color bgColor = graphics.GetBackgroundColor();
 }