Index: Core/Plugins/src/Core.Plugins.CommonTools.Gui/Property/ProjectProperties.cs =================================================================== diff -u -r261638422bd5d4f04f8f4cc9862d2c0a8e83c500 -rbf75c9da1c6bb5141bdd9785db3ba73142019399 --- Core/Plugins/src/Core.Plugins.CommonTools.Gui/Property/ProjectProperties.cs (.../ProjectProperties.cs) (revision 261638422bd5d4f04f8f4cc9862d2c0a8e83c500) +++ Core/Plugins/src/Core.Plugins.CommonTools.Gui/Property/ProjectProperties.cs (.../ProjectProperties.cs) (revision bf75c9da1c6bb5141bdd9785db3ba73142019399) @@ -38,18 +38,5 @@ data.Description = value; } } - - [TypeConverter(typeof(ChartFontPropertiesConverter))] - public Font SomeFont - { - get - { - return new Font(FontFamily.GenericSansSerif, 12); - } - set - { - - } - } } } \ No newline at end of file Index: Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/ChartAxisPropertiesTest.cs =================================================================== diff -u -r261638422bd5d4f04f8f4cc9862d2c0a8e83c500 -rbf75c9da1c6bb5141bdd9785db3ba73142019399 --- Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/ChartAxisPropertiesTest.cs (.../ChartAxisPropertiesTest.cs) (revision 261638422bd5d4f04f8f4cc9862d2c0a8e83c500) +++ Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/ChartAxisPropertiesTest.cs (.../ChartAxisPropertiesTest.cs) (revision bf75c9da1c6bb5141bdd9785db3ba73142019399) @@ -1,5 +1,4 @@ -using System; -using System.Drawing; +using System.Drawing; using Core.Common.Controls.Charting; using Core.Plugins.CommonTools.Gui.Property.Charting; using NUnit.Framework; Index: Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/ChartPropertiesTest.cs =================================================================== diff -u -rdcbdbeca4b85fa721a84c331f6a10c07b8066fd2 -rbf75c9da1c6bb5141bdd9785db3ba73142019399 --- Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/ChartPropertiesTest.cs (.../ChartPropertiesTest.cs) (revision dcbdbeca4b85fa721a84c331f6a10c07b8066fd2) +++ Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/ChartPropertiesTest.cs (.../ChartPropertiesTest.cs) (revision bf75c9da1c6bb5141bdd9785db3ba73142019399) @@ -11,7 +11,7 @@ public class ChartPropertiesTest { [Test] - public void Constructor_WithAxis_ExpectedValues() + public void DefaultConstructor_ExpectedValues() { // Call var properties = new ChartProperties(); Index: Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/ChartSeriesPropertiesTest.cs =================================================================== diff -u -rdcbdbeca4b85fa721a84c331f6a10c07b8066fd2 -rbf75c9da1c6bb5141bdd9785db3ba73142019399 --- Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/ChartSeriesPropertiesTest.cs (.../ChartSeriesPropertiesTest.cs) (revision dcbdbeca4b85fa721a84c331f6a10c07b8066fd2) +++ Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/ChartSeriesPropertiesTest.cs (.../ChartSeriesPropertiesTest.cs) (revision bf75c9da1c6bb5141bdd9785db3ba73142019399) @@ -1,5 +1,4 @@ -using System; -using Core.Common.Controls.Charting; +using Core.Common.Controls.Charting; using Core.Common.Gui; using Core.Plugins.CommonTools.Gui.Property.Charting; using NUnit.Framework; @@ -11,18 +10,14 @@ public class ChartSeriesPropertiesTest { [Test] - public void Constructor_WithAxis_ExpectedValues() + public void DefaultConstructor_ExpectedValues() { // Call - var mocks = new MockRepository(); - var chartSeries = mocks.StrictMock(); - var properties = new ChartSeriesProperties - { - Data = chartSeries - }; + var properties = new ChartSeriesProperties(); // Assert Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); } [Test] Index: Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/LineChartSeriesPropertiesTest.cs =================================================================== diff -u -r62bda0a2744de5708f3cea188d90839e06908cc0 -rbf75c9da1c6bb5141bdd9785db3ba73142019399 --- Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/LineChartSeriesPropertiesTest.cs (.../LineChartSeriesPropertiesTest.cs) (revision 62bda0a2744de5708f3cea188d90839e06908cc0) +++ Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/LineChartSeriesPropertiesTest.cs (.../LineChartSeriesPropertiesTest.cs) (revision bf75c9da1c6bb5141bdd9785db3ba73142019399) @@ -1,10 +1,126 @@ -using NUnit.Framework; +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using Core.Common.Controls.Charting; +using Core.Common.Controls.Charting.Series; +using Core.Plugins.CommonTools.Gui.Property.Charting; +using NUnit.Framework; +using Rhino.Mocks; namespace Core.Plugins.CommonTools.Gui.Test.Property.Charting { [TestFixture] public class LineChartSeriesPropertiesTest { - + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new LineChartSeriesProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + var mocks = new MockRepository(); + var random = new Random(21); + var interpolationType = InterpolationType.Linear; + var titleLabelVisible = false; + var color = Color.AliceBlue; + var width = random.Next(1, 10); + var dashStyle = DashStyle.Dash; + var pointerSize = random.Next(1,10); + var pointerLineColor = Color.AliceBlue; + var pointerStyle = PointerStyles.SmallDot; + var pointerVisible = false; + var pointerLineVisible = false; + var chartSeries = mocks.StrictMock(); + + chartSeries.Expect(a => a.InterpolationType).Return(interpolationType); + chartSeries.Expect(a => a.TitleLabelVisible).Return(titleLabelVisible); + chartSeries.Expect(a => a.Color).Return(color); + chartSeries.Expect(a => a.Width).Return(width); + chartSeries.Expect(a => a.DashStyle).Return(dashStyle); + chartSeries.Expect(a => a.PointerSize).Return(pointerSize); + chartSeries.Expect(a => a.PointerLineColor).Return(pointerLineColor); + chartSeries.Expect(a => a.PointerStyle).Return(pointerStyle); + chartSeries.Expect(a => a.PointerVisible).Return(pointerVisible); + chartSeries.Expect(a => a.PointerLineVisible).Return(pointerLineVisible); + + mocks.ReplayAll(); + + var properties = new LineChartSeriesProperties{ + Data = chartSeries + }; + + // Call & Assert + Assert.AreEqual(interpolationType, properties.InterpolationType); + Assert.AreEqual(titleLabelVisible, properties.TitleLabelVisible); + Assert.AreEqual(color, properties.Color); + Assert.AreEqual(width, properties.Width); + Assert.AreEqual(dashStyle, properties.DashStyle); + Assert.AreEqual(pointerSize, properties.PointerSize); + Assert.AreEqual(pointerLineColor, properties.PointerLineColor); + Assert.AreEqual(pointerStyle, properties.PointerStyle); + Assert.AreEqual(pointerVisible, properties.PointerVisible); + Assert.AreEqual(pointerLineVisible, properties.PointerLineVisible); + + mocks.VerifyAll(); + } + + [Test] + public void SetProperties_WithData_CallsSetters() + { + // Setup + var mocks = new MockRepository(); + var random = new Random(21); + var interpolationType = InterpolationType.Linear; + var titleLabelVisible = false; + var color = Color.AliceBlue; + var width = random.Next(1, 10); + var dashStyle = DashStyle.Dash; + var pointerSize = random.Next(1, 10); + var pointerLineColor = Color.AliceBlue; + var pointerStyle = PointerStyles.SmallDot; + var pointerVisible = false; + var pointerLineVisible = false; + var chartSeries = mocks.StrictMock(); + + chartSeries.Expect(a => a.InterpolationType).SetPropertyWithArgument(interpolationType); + chartSeries.Expect(a => a.TitleLabelVisible).SetPropertyWithArgument(titleLabelVisible); + chartSeries.Expect(a => a.Color).SetPropertyWithArgument(color); + chartSeries.Expect(a => a.Width).SetPropertyWithArgument(width); + chartSeries.Expect(a => a.DashStyle).SetPropertyWithArgument(dashStyle); + chartSeries.Expect(a => a.PointerSize).SetPropertyWithArgument(pointerSize); + chartSeries.Expect(a => a.PointerLineColor).SetPropertyWithArgument(pointerLineColor); + chartSeries.Expect(a => a.PointerStyle).SetPropertyWithArgument(pointerStyle); + chartSeries.Expect(a => a.PointerVisible).SetPropertyWithArgument(pointerVisible); + chartSeries.Expect(a => a.PointerLineVisible).SetPropertyWithArgument(pointerLineVisible); + + mocks.ReplayAll(); + + // Call + new LineChartSeriesProperties{ + Data = chartSeries, + InterpolationType = interpolationType, + TitleLabelVisible = titleLabelVisible, + Color = color, + Width = width, + DashStyle = dashStyle, + PointerSize = pointerSize, + PointerLineColor = pointerLineColor, + PointerStyle = pointerStyle, + PointerVisible = pointerVisible, + PointerLineVisible = pointerLineVisible + }; + + // Assert + mocks.VerifyAll(); + } } } \ No newline at end of file Index: Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/PointChartSeriesPropertiesTest.cs =================================================================== diff -u -r62bda0a2744de5708f3cea188d90839e06908cc0 -rbf75c9da1c6bb5141bdd9785db3ba73142019399 --- Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/PointChartSeriesPropertiesTest.cs (.../PointChartSeriesPropertiesTest.cs) (revision 62bda0a2744de5708f3cea188d90839e06908cc0) +++ Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/PointChartSeriesPropertiesTest.cs (.../PointChartSeriesPropertiesTest.cs) (revision bf75c9da1c6bb5141bdd9785db3ba73142019399) @@ -1,10 +1,97 @@ -using NUnit.Framework; +using System; +using System.Drawing; +using Core.Common.Controls.Charting; +using Core.Common.Controls.Charting.Series; +using Core.Plugins.CommonTools.Gui.Property.Charting; +using NUnit.Framework; +using Rhino.Mocks; namespace Core.Plugins.CommonTools.Gui.Test.Property.Charting { [TestFixture] public class PointChartSeriesPropertiesTest { - + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new PointChartSeriesProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + var mocks = new MockRepository(); + var random = new Random(21); + var color = Color.AliceBlue; + var lineColor = Color.AliceBlue; + var pointerLineVisible = false; + var size = random.Next(1, 10); + var style = PointerStyles.SmallDot; + var chartSeries = mocks.StrictMock(); + + chartSeries.Expect(a => a.Color).Return(color); + chartSeries.Expect(a => a.LineColor).Return(lineColor); + chartSeries.Expect(a => a.LineVisible).Return(pointerLineVisible); + chartSeries.Expect(a => a.Size).Return(size); + chartSeries.Expect(a => a.Style).Return(style); + + mocks.ReplayAll(); + + var properties = new PointChartSeriesProperties + { + Data = chartSeries + }; + + // Call & Assert + Assert.AreEqual(color, properties.Color); + Assert.AreEqual(lineColor, properties.LineColor); + Assert.AreEqual(pointerLineVisible, properties.PointerLineVisible); + Assert.AreEqual(size, properties.Size); + Assert.AreEqual(style, properties.Style); + + mocks.VerifyAll(); + } + + [Test] + public void SetProperties_WithData_CallsSetters() + { + // Setup + var mocks = new MockRepository(); + var random = new Random(21); + var color = Color.AliceBlue; + var lineColor = Color.AliceBlue; + var pointerLineVisible = false; + var size = random.Next(1, 10); + var style = PointerStyles.SmallDot; + var chartSeries = mocks.StrictMock(); + + chartSeries.Expect(a => a.Color).SetPropertyWithArgument(color); + chartSeries.Expect(a => a.LineColor).SetPropertyWithArgument(lineColor); + chartSeries.Expect(a => a.LineVisible).SetPropertyWithArgument(pointerLineVisible); + chartSeries.Expect(a => a.Size).SetPropertyWithArgument(size); + chartSeries.Expect(a => a.Style).SetPropertyWithArgument(style); + + mocks.ReplayAll(); + + // Call + new PointChartSeriesProperties + { + Data = chartSeries, + Color = color, + LineColor = lineColor, + PointerLineVisible = pointerLineVisible, + Size = size, + Style = style + }; + + // Assert + mocks.VerifyAll(); + } } } \ No newline at end of file Index: Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/PolygonChartSeriesPropertiesTest.cs =================================================================== diff -u -r62bda0a2744de5708f3cea188d90839e06908cc0 -rbf75c9da1c6bb5141bdd9785db3ba73142019399 --- Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/PolygonChartSeriesPropertiesTest.cs (.../PolygonChartSeriesPropertiesTest.cs) (revision 62bda0a2744de5708f3cea188d90839e06908cc0) +++ Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Property/Charting/PolygonChartSeriesPropertiesTest.cs (.../PolygonChartSeriesPropertiesTest.cs) (revision bf75c9da1c6bb5141bdd9785db3ba73142019399) @@ -1,10 +1,122 @@ -using NUnit.Framework; +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using Core.Common.Controls.Charting.Series; +using Core.Plugins.CommonTools.Gui.Property.Charting; +using NUnit.Framework; +using Rhino.Mocks; namespace Core.Plugins.CommonTools.Gui.Test.Property.Charting { [TestFixture] public class PolygonChartSeriesPropertiesTest { - + + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new PolygonChartSeriesProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + var mocks = new MockRepository(); + var random = new Random(21); + var closed = false; + var color = Color.AliceBlue; + var transparency = random.Next(1, 10); + var useHatch = false; + var hatchStyle = HatchStyle.Cross; + var hatchColor = Color.AliceBlue; + var lineColor = Color.AliceBlue; + var lineWidth = random.Next(1, 10); + var lineVisible = false; + var chartSeries = mocks.StrictMock(); + + chartSeries.Expect(a => a.AutoClose).Return(closed); + chartSeries.Expect(a => a.Color).Return(color); + chartSeries.Expect(a => a.Transparency).Return(transparency); + chartSeries.Expect(a => a.UseHatch).Return(useHatch); + chartSeries.Expect(a => a.HatchStyle).Return(hatchStyle); + chartSeries.Expect(a => a.HatchColor).Return(hatchColor); + chartSeries.Expect(a => a.LineColor).Return(lineColor); + chartSeries.Expect(a => a.LineWidth).Return(lineWidth); + chartSeries.Expect(a => a.LineVisible).Return(lineVisible); + + mocks.ReplayAll(); + + var properties = new PolygonChartSeriesProperties + { + Data = chartSeries + }; + + // Call & Assert + Assert.AreEqual(closed, properties.Closed); + Assert.AreEqual(color, properties.Color); + Assert.AreEqual(transparency, properties.Transparency); + Assert.AreEqual(useHatch, properties.UseHatch); + Assert.AreEqual(hatchStyle, properties.HatchStyle); + Assert.AreEqual(hatchColor, properties.HatchColor); + Assert.AreEqual(lineColor, properties.LineColor); + Assert.AreEqual(lineWidth, properties.LineWidth); + Assert.AreEqual(lineVisible, properties.LineVisible); + + mocks.VerifyAll(); + } + + [Test] + public void SetProperties_WithData_CallsSetters() + { + // Setup + var mocks = new MockRepository(); + var random = new Random(21); + var closed = false; + var color = Color.AliceBlue; + var transparency = random.Next(1, 10); + var useHatch = false; + var hatchStyle = HatchStyle.Cross; + var hatchColor = Color.AliceBlue; + var lineColor = Color.AliceBlue; + var lineWidth = random.Next(1, 10); + var lineVisible = false; + var chartSeries = mocks.StrictMock(); + + chartSeries.Expect(a => a.AutoClose).SetPropertyWithArgument(closed); + chartSeries.Expect(a => a.Color).SetPropertyWithArgument(color); + chartSeries.Expect(a => a.Transparency).SetPropertyWithArgument(transparency); + chartSeries.Expect(a => a.UseHatch).SetPropertyWithArgument(useHatch); + chartSeries.Expect(a => a.HatchStyle).SetPropertyWithArgument(hatchStyle); + chartSeries.Expect(a => a.HatchColor).SetPropertyWithArgument(hatchColor); + chartSeries.Expect(a => a.LineColor).SetPropertyWithArgument(lineColor); + chartSeries.Expect(a => a.LineWidth).SetPropertyWithArgument(lineWidth); + chartSeries.Expect(a => a.LineVisible).SetPropertyWithArgument(lineVisible); + + mocks.ReplayAll(); + + // Call + new PolygonChartSeriesProperties + { + Data = chartSeries, + Closed = closed, + Color = color, + Transparency = transparency, + UseHatch = useHatch, + HatchStyle = hatchStyle, + HatchColor = hatchColor, + LineColor = lineColor, + LineWidth = lineWidth, + LineVisible = lineVisible + }; + + // Assert + mocks.VerifyAll(); + } } } \ No newline at end of file