Index: Core/Common/src/Core.Common.Base/Data/RoundedDouble.cs =================================================================== diff -u -r41a37c93cb0b3e36ff7023c9f42b4e6225598b55 -rba63727b1fada130c04d9006805ec9a28fe21b65 --- Core/Common/src/Core.Common.Base/Data/RoundedDouble.cs (.../RoundedDouble.cs) (revision 41a37c93cb0b3e36ff7023c9f42b4e6225598b55) +++ Core/Common/src/Core.Common.Base/Data/RoundedDouble.cs (.../RoundedDouble.cs) (revision ba63727b1fada130c04d9006805ec9a28fe21b65) @@ -43,7 +43,7 @@ /// Represents a value that is not a number (NaN). This field is constant. /// /// - public readonly static RoundedDouble NaN = new RoundedDouble(MaximumNumberOfDecimalPlaces, double.NaN); + public static readonly RoundedDouble NaN = new RoundedDouble(MaximumNumberOfDecimalPlaces, double.NaN); private readonly double value; private readonly int numberOfDecimalPlaces; Index: Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs =================================================================== diff -u -rbd8a4787e4ef26cf7e50d768f053fdc57f075713 -rba63727b1fada130c04d9006805ec9a28fe21b65 --- Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs (.../DataGridViewControl.cs) (revision bd8a4787e4ef26cf7e50d768f053fdc57f075713) +++ Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs (.../DataGridViewControl.cs) (revision ba63727b1fada130c04d9006805ec9a28fe21b65) @@ -409,7 +409,10 @@ private void DataGridViewOnCellClick(object sender, DataGridViewCellEventArgs e) { - if (e.RowIndex == -1 || e.ColumnIndex == -1) return; + if (e.RowIndex == -1 || e.ColumnIndex == -1) + { + return; + } dataGridView.BeginEdit(true); ComboBox combobox = dataGridView.EditingControl as ComboBox; Index: Core/Common/test/Core.Common.Base.Test/Geometry/Math2DTest.cs =================================================================== diff -u -re42bdf3dd379c46bab9212eb7b30f4754c9bc91c -rba63727b1fada130c04d9006805ec9a28fe21b65 --- Core/Common/test/Core.Common.Base.Test/Geometry/Math2DTest.cs (.../Math2DTest.cs) (revision e42bdf3dd379c46bab9212eb7b30f4754c9bc91c) +++ Core/Common/test/Core.Common.Base.Test/Geometry/Math2DTest.cs (.../Math2DTest.cs) (revision ba63727b1fada130c04d9006805ec9a28fe21b65) @@ -33,112 +33,6 @@ [TestFixture] public class Math2DTest { - #region testcases - - /// - /// Test cases for intersecting segments. The contains pairs of , - /// which represent the coordinate of a point. Each pair of coordinates forms a segment. - /// The last 2 double values are the expected intersection points. - /// - private static IEnumerable IntersectingSegments() - { - // \/ - // /\ - var testCaseDatadata1 = new TestCaseData(new[] - { - new Point2D(0.0, 0.0), - new Point2D(1.0, 1.0), - new Point2D(1.0, 0.0), - new Point2D(0.0, 1.0), - new Point2D(0.5, 0.5) - }, "IntersectingSegments 1"); - yield return testCaseDatadata1; - - // __ - // / - // / - var testCaseDatadata2 = new TestCaseData(new[] - { - new Point2D(0.0, 0.0), - new Point2D(1.0, 1.0), - new Point2D(0.0, 1.0), - new Point2D(1.0, 1.0), - new Point2D(1.0, 1.0) - }, "IntersectingSegments 2"); - yield return testCaseDatadata2; - - // - // / - // /__ - var testCaseDatadata3 = new TestCaseData(new[] - { - new Point2D(0.0, 0.0), - new Point2D(1.0, 0.0), - new Point2D(0.0, 0.0), - new Point2D(1.0, 1.0), - new Point2D(0.0, 0.0) - }, "IntersectingSegments 3"); - yield return testCaseDatadata3; - } - - /// - /// Test cases for parallel segments. The contains pairs of , - /// which represent the coordinate of a point. Each pair of coordinates forms a segment. - /// - private static IEnumerable ParallelSegments() - { - // __ - // __ - var testCaseDatadata1 = new TestCaseData(new[] - { - new Point2D(0.0, 0.0), - new Point2D(1.0, 0.0), - new Point2D(0.0, 1.0), - new Point2D(1.0, 1.0) - }, "ParallelSegments"); - yield return testCaseDatadata1; - - // ____ (connected in single point) - var testCaseDatadata2 = new TestCaseData(new[] - { - new Point2D(0.0, 0.0), - new Point2D(1.0, 0.0), - new Point2D(1.0, 0.0), - new Point2D(2.0, 0.0) - }, "ParallelSegments, connected in single point"); - yield return testCaseDatadata2; - - // __ (overlap) - var testCaseDatadata3 = new TestCaseData(new[] - { - new Point2D(0.0, 0.0), - new Point2D(1.0, 0.0), - new Point2D(0.5, 0.0), - new Point2D(1.5, 0.0) - }, "ParallelSegments, overlap"); - yield return testCaseDatadata3; - } - - /// - /// Test cases for non intersecting segments. The contains pairs of , - /// which represent the coordinate of a point. Each pair of coordinates forms a segment. - /// - private static readonly Point2D[][] nonIntersectingSegments = - { - // | - // ___ - new[] - { - new Point2D(0.0, 0.0), - new Point2D(1.0, 0.0), - new Point2D(0.5, 1.0), - new Point2D(0.5, 0.5), - new Point2D(0.5, 0.0) - } - }; - - #endregion - [Test] [TestCase(0, "line1Point1")] [TestCase(1, "line1Point2")] @@ -415,7 +309,7 @@ new Point2D(20.0, 60.0), }; - var lengths = GetLengthsBasedOnReletative(new[] + var lengths = GetLengthsBasedOnRelative(new[] { 0.25, 0.25, @@ -1317,10 +1211,116 @@ } } - private double[] GetLengthsBasedOnReletative(double[] relativeLengths, IEnumerable lineGeometryPoints) + private static double[] GetLengthsBasedOnRelative(double[] relativeLengths, IEnumerable lineGeometryPoints) { var lineLength = Math2D.ConvertLinePointsToLineSegments(lineGeometryPoints).Sum(s => s.Length); return relativeLengths.Select(l => lineLength*l).ToArray(); } + + #region testcases + + /// + /// Test cases for intersecting segments. The contains pairs of , + /// which represent the coordinate of a point. Each pair of coordinates forms a segment. + /// The last 2 double values are the expected intersection points. + /// + private static IEnumerable IntersectingSegments() + { + // \/ + // /\ + var testCaseDatadata1 = new TestCaseData(new[] + { + new Point2D(0.0, 0.0), + new Point2D(1.0, 1.0), + new Point2D(1.0, 0.0), + new Point2D(0.0, 1.0), + new Point2D(0.5, 0.5) + }, "IntersectingSegments 1"); + yield return testCaseDatadata1; + + // __ + // / + // / + var testCaseDatadata2 = new TestCaseData(new[] + { + new Point2D(0.0, 0.0), + new Point2D(1.0, 1.0), + new Point2D(0.0, 1.0), + new Point2D(1.0, 1.0), + new Point2D(1.0, 1.0) + }, "IntersectingSegments 2"); + yield return testCaseDatadata2; + + // + // / + // /__ + var testCaseDatadata3 = new TestCaseData(new[] + { + new Point2D(0.0, 0.0), + new Point2D(1.0, 0.0), + new Point2D(0.0, 0.0), + new Point2D(1.0, 1.0), + new Point2D(0.0, 0.0) + }, "IntersectingSegments 3"); + yield return testCaseDatadata3; + } + + /// + /// Test cases for parallel segments. The contains pairs of , + /// which represent the coordinate of a point. Each pair of coordinates forms a segment. + /// + private static IEnumerable ParallelSegments() + { + // __ + // __ + var testCaseDatadata1 = new TestCaseData(new[] + { + new Point2D(0.0, 0.0), + new Point2D(1.0, 0.0), + new Point2D(0.0, 1.0), + new Point2D(1.0, 1.0) + }, "ParallelSegments"); + yield return testCaseDatadata1; + + // ____ (connected in single point) + var testCaseDatadata2 = new TestCaseData(new[] + { + new Point2D(0.0, 0.0), + new Point2D(1.0, 0.0), + new Point2D(1.0, 0.0), + new Point2D(2.0, 0.0) + }, "ParallelSegments, connected in single point"); + yield return testCaseDatadata2; + + // __ (overlap) + var testCaseDatadata3 = new TestCaseData(new[] + { + new Point2D(0.0, 0.0), + new Point2D(1.0, 0.0), + new Point2D(0.5, 0.0), + new Point2D(1.5, 0.0) + }, "ParallelSegments, overlap"); + yield return testCaseDatadata3; + } + + /// + /// Test cases for non intersecting segments. The contains pairs of , + /// which represent the coordinate of a point. Each pair of coordinates forms a segment. + /// + private static readonly Point2D[][] nonIntersectingSegments = + { + // | + // ___ + new[] + { + new Point2D(0.0, 0.0), + new Point2D(1.0, 0.0), + new Point2D(0.5, 1.0), + new Point2D(0.5, 0.5), + new Point2D(0.5, 0.0) + } + }; + + #endregion } } \ No newline at end of file Index: Core/Common/test/Core.Common.TestUtil/RandomExtensions.cs =================================================================== diff -u -r5bdd0c27e3d42a0d68a6e9abea9b875d0e06cb5f -rba63727b1fada130c04d9006805ec9a28fe21b65 --- Core/Common/test/Core.Common.TestUtil/RandomExtensions.cs (.../RandomExtensions.cs) (revision 5bdd0c27e3d42a0d68a6e9abea9b875d0e06cb5f) +++ Core/Common/test/Core.Common.TestUtil/RandomExtensions.cs (.../RandomExtensions.cs) (revision ba63727b1fada130c04d9006805ec9a28fe21b65) @@ -51,7 +51,7 @@ } double difference = upperLimit - lowerLimit; - double randomValue = lowerLimit + random.NextDouble() * difference; + double randomValue = lowerLimit + random.NextDouble()*difference; if (double.IsInfinity(randomValue) || double.IsNaN(randomValue)) { string message = string.Format("Creating a new random value with lower limit {0} " +