From 8c403d4e2a28eb91e6b1fbeb7eba5b71dea2a1bf Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Sat, 20 Oct 2018 17:59:29 +0100 Subject: [PATCH] add test which checkes the colour of solid colour brush. The colour of the brush is set using individual RGBA values. --- TestCentre/LibraryTests.fs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/TestCentre/LibraryTests.fs b/TestCentre/LibraryTests.fs index 152758a..b9dfcc3 100644 --- a/TestCentre/LibraryTests.fs +++ b/TestCentre/LibraryTests.fs @@ -99,12 +99,14 @@ (File.Exists sPath) = true [] - // need to write a test which tests the colour is the same once coverted. - let ``Can make a solid brush from RGBA values`` () = - let brush = - makeSolidBrushFromRGBA (newRGBANum ()) (newRGBANum ()) (newRGBANum ()) (newRGBANum ()) - let b = brush :? SolidBrush - b = true + let ``SolidBrush colour matches the individual RGBA values`` () = + let a = newRGBANum () + let r = newRGBANum () + let g = newRGBANum () + let b = newRGBANum () + let referenceColour = Color.FromArgb (a, r, g, b) + let brush = makeSolidBrushFromRGBA r g b a + brush.Color = referenceColour []