Index: test/Common/SharpMap.Tests/Rendering/Thematics/QuantityThemeTest.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- test/Common/SharpMap.Tests/Rendering/Thematics/QuantityThemeTest.cs (.../QuantityThemeTest.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ test/Common/SharpMap.Tests/Rendering/Thematics/QuantityThemeTest.cs (.../QuantityThemeTest.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -11,20 +11,6 @@ [TestFixture] public class QuantityThemeTest { - // Some test objects the tests can use - - - private static IStyle GenerateVectorStyle(Brush brush) - { - return new VectorStyle - { - Line = new Pen(Color.Red, 2), - Outline = new Pen(Color.Blue, 3), - EnableOutline = true, - Fill = brush - }; - } - [Test] public void QuantityThemeColorTest() { @@ -39,31 +25,51 @@ quantityTheme.AddStyle(redStyle, new Interval(0.0, 1.0)); quantityTheme.AddStyle(blueStyle, new Interval(2.0, 3.0)); quantityTheme.AddStyle(whiteStyle, new Interval(1.0, 2.0)); - quantityTheme.NoDataValues = new[] {-999.0}; + quantityTheme.NoDataValues = new[] + { + -999.0 + }; - //value within interval Assert.IsTrue(CompareRGBColor(Color.Red, quantityTheme.GetFillColor(0.5))); Assert.IsTrue(CompareRGBColor(Color.White, quantityTheme.GetFillColor(1.5))); Assert.IsTrue(CompareRGBColor(Color.Blue, quantityTheme.GetFillColor(2.5))); - //no data value Assert.IsTrue(CompareRGBColor(Pens.Transparent.Color, quantityTheme.GetFillColor(-999.0))); } - private static bool CompareRGBColor(Color color, Color fillColor) - { - return color.R == fillColor.R && color.G == fillColor.G && color.B == fillColor.B; - } - [Test] public void CloneQuantityThemeWithNoDataValues() { - var quantityTheme = new QuantityTheme("aa",new VectorStyle()){ NoDataValues = new List { -9999 } }; + var quantityTheme = new QuantityTheme("aa", new VectorStyle()) + { + NoDataValues = new List + { + -9999 + } + }; var quantityThemeClone = quantityTheme.Clone(); - Assert.AreEqual(quantityTheme.NoDataValues, ((QuantityTheme)quantityThemeClone).NoDataValues); + Assert.AreEqual(quantityTheme.NoDataValues, ((QuantityTheme) quantityThemeClone).NoDataValues); } + + // Some test objects the tests can use + + private static IStyle GenerateVectorStyle(Brush brush) + { + return new VectorStyle + { + Line = new Pen(Color.Red, 2), + Outline = new Pen(Color.Blue, 3), + EnableOutline = true, + Fill = brush + }; + } + + private static bool CompareRGBColor(Color color, Color fillColor) + { + return color.R == fillColor.R && color.G == fillColor.G && color.B == fillColor.B; + } } } \ No newline at end of file