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); }
public void GetBackgroundColorTest() { GraphicsRepository <Bitmap, Color> graphics = new GraphicsRepository <Bitmap, Color>(); Color bgColor = graphics.GetBackgroundColor(); }