Skip to content

Commit 5de7c4d

Browse files
author
Petr Sramek
committed
removed regions
1 parent 6a350d7 commit 5de7c4d

11 files changed

+11
-71
lines changed

src/Constants.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ namespace DropoutCoder.PolylineAlgorithm
1010
/// </summary>
1111
internal static class Constants
1212
{
13-
#region Constants
14-
1513
/// <summary>
1614
/// Defines the coordinate precision
1715
/// </summary>
@@ -22,15 +20,11 @@ internal static class Constants
2220
/// </summary>
2321
public const int ShiftLength = 5;
2422

25-
#endregion
26-
2723
/// <summary>
2824
/// Defines ASCII characters constant values
2925
/// </summary>
3026
internal static class ASCII
3127
{
32-
#region Constants
33-
3428
/// <summary>
3529
/// Defines the ASCII Question Mark
3630
/// </summary>
@@ -45,17 +39,13 @@ internal static class ASCII
4539
/// Defines the ASCII Unit Separator
4640
/// </summary>
4741
public const int UnitSeparator = 31;
48-
49-
#endregion
5042
}
5143

5244
/// <summary>
5345
/// Defines coordinates constant values
5446
/// </summary>
5547
internal static class Coordinate
5648
{
57-
#region Constants
58-
5949
/// <summary>
6050
/// Defines the maximum value for latitude
6151
/// </summary>
@@ -75,8 +65,6 @@ internal static class Coordinate
7565
/// Defines the minimum value for longitude
7666
/// </summary>
7767
public const int MinLongitude = -MaxLongitude;
78-
79-
#endregion
8068
}
8169
}
8270
}

src/Encoding/IPolylineEncoding.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@ namespace DropoutCoder.PolylineAlgorithm.Encoding
77
{
88
using System.Collections.Generic;
99

10-
#region Interfaces
11-
1210
/// <summary>
1311
/// Defines base interface for all polyline encodings
1412
/// </summary>
1513
/// <typeparam name="T">Desired type used to decode to and encode from</typeparam>
1614
public interface IPolylineEncoding<T>
1715
{
18-
#region Methods
19-
2016
/// <summary>
2117
/// Method performs decoding from polyline encoded <see cref="string"/> to <see cref="IEnumerable{T}"/>
2218
/// </summary>
@@ -30,9 +26,5 @@ public interface IPolylineEncoding<T>
3026
/// <param name="source">Coordinates to encode</param>
3127
/// <returns>Polyline encoded result</returns>
3228
string Encode(IEnumerable<T> source);
33-
34-
#endregion
3529
}
36-
37-
#endregion
3830
}

src/Encoding/PolylineEncoding.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ namespace DropoutCoder.PolylineAlgorithm.Encoding
1010
/// </summary>
1111
public class PolylineEncoding : PolylineEncodingBase<(double Latitude, double Longitude)>
1212
{
13-
#region Methods
14-
1513
/// <summary>
1614
/// Method creates <see cref="System.ValueTuple[double, double]"/> result from passed latitude and longitude arguments
1715
/// </summary>
@@ -32,7 +30,5 @@ protected override (double Latitude, double Longitude) GetCoordinate((double Lat
3230
{
3331
return source;
3432
}
35-
36-
#endregion
3733
}
3834
}

src/Encoding/PolylineEncodingBase.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@ namespace DropoutCoder.PolylineAlgorithm.Encoding
1515
/// <typeparam name="T"></typeparam>
1616
public abstract class PolylineEncodingBase<T> : IPolylineEncoding<T>
1717
{
18-
#region Methods
19-
2018
/// <summary>
2119
/// Method performs decode operation and coversion to desired type
2220
/// </summary>
2321
/// <param name="source">The <see cref="string"/></param>
2422
/// <returns>The <see cref="IEnumerable{T}"/></returns>
2523
public IEnumerable<T> Decode(string source)
2624
{
27-
if (string.IsNullOrEmpty(source))
25+
if (string.IsNullOrWhiteSpace(source))
2826
{
2927
throw new ArgumentException(ExceptionMessageResource.ArgumentCannotBeNullOrEmpty, nameof(source));
3028
}
@@ -66,7 +64,5 @@ public string Encode(IEnumerable<T> source)
6664
/// <param name="source">The <see cref="T"/></param>
6765
/// <returns>The <see cref="System.ValueTuple[double, double]"/></returns>
6866
protected abstract (double Latitude, double Longitude) GetCoordinate(T source);
69-
70-
#endregion
7167
}
7268
}

src/PolylineAlgorithm.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ public static class PolylineAlgorithm
1919
{
2020
private static readonly ObjectPool<StringBuilder> _pool = new DefaultObjectPoolProvider().CreateStringBuilderPool(5, 250);
2121

22-
#region Methods
23-
2422
/// <summary>
2523
/// Method decodes polyline encoded representation to coordinates.
2624
/// </summary>
@@ -210,7 +208,5 @@ private static bool TryCalculateNext(char[] polyline, ref int index, ref int val
210208

211209
return true;
212210
}
213-
214-
#endregion
215211
}
216212
}

src/Validation/CoordinateValidator.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ namespace DropoutCoder.PolylineAlgorithm.Validation
1010
/// </summary>
1111
public static class CoordinateValidator
1212
{
13-
#region Methods
14-
1513
/// <summary>
1614
/// Performs coordinate validation
1715
/// </summary>
@@ -41,7 +39,5 @@ public static bool IsValidLongitude(double longitude)
4139
{
4240
return longitude >= Constants.Coordinate.MinLongitude && longitude <= Constants.Coordinate.MaxLongitude;
4341
}
44-
45-
#endregion
4642
}
4743
}

tests/Defaults.cs

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ public static class Defaults
1919
/// </summary>
2020
public static class Coordinate
2121
{
22-
#region Fields
23-
2422
/// <summary>
2523
/// Defines empty range of coordinates. Equals to decoded <seealso cref="Polyline.Empty"/>
2624
/// </summary>
@@ -30,32 +28,28 @@ public static class Coordinate
3028
/// Defines range of invalid coordinates. Equals to decoded <seealso cref="Polyline.Invalid"/>
3129
/// </summary>
3230
public static readonly IEnumerable<(double Latitude, double Longitude)> Invalid = new[] {
33-
(149.47383, 259.06250),
34-
(-158.37407, 225.31250),
35-
(152.99363, -220.93750),
36-
(-144.49024, -274.37500)
37-
};
31+
(149.47383, 259.06250),
32+
(-158.37407, 225.31250),
33+
(152.99363, -220.93750),
34+
(-144.49024, -274.37500)
35+
};
3836

3937
/// <summary>
4038
/// Defines range of valid coordinates. Equals to decoded <seealso cref="Polyline.Valid"/>
4139
/// </summary>
4240
public static readonly IEnumerable<(double Latitude, double Longitude)> Valid = new[] {
43-
(49.47383, 59.06250),
44-
(-58.37407, 25.31250),
45-
(52.99363, -120.93750),
46-
(-44.49024, -174.37500)
47-
};
48-
49-
#endregion
41+
(49.47383, 59.06250),
42+
(-58.37407, 25.31250),
43+
(52.99363, -120.93750),
44+
(-44.49024, -174.37500)
45+
};
5046
}
5147

5248
/// <summary>
5349
/// Defines default encoded values and objects udśed for testing purposes
5450
/// </summary>
5551
public static class Polyline
5652
{
57-
#region Fields
58-
5953
/// <summary>
6054
/// Defines empty string of polyline encoded coordinates. Equals to encoded <seealso cref="Coordinate.Empty"/>
6155
/// </summary>
@@ -70,8 +64,6 @@ public static class Polyline
7064
/// Defines polyline encoded range of valid coordinates. Equals to encoded <seealso cref="Coordinate.Valid"/>
7165
/// </summary>
7266
public static readonly string Valid = "mz}lHssngJj`gqSnx~lEcovfTnms{Zdy~qQj_deI";
73-
74-
#endregion
7567
}
7668
}
7769
}

tests/Encoding/PolylineEncodingBaseTest.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ namespace DropoutCoder.PolylineAlgorithm.Tests.Encoding
1818
[TestCategory(nameof(PolylineEncodingBase<(double latitude, double longitude)>))]
1919
public class PolylineEncodingBaseTest : PolylineEncodingBase<(double latitude, double longitude)>
2020
{
21-
#region Methods
22-
2321
/// <summary>
2422
/// The Decode_NullInput
2523
/// </summary>
@@ -190,7 +188,5 @@ protected override (double Latitude, double Longitude) GetCoordinate((double lat
190188
}
191189

192190
#endregion
193-
194-
#endregion
195191
}
196192
}

tests/Encoding/PolylineEncodingTest.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ namespace DropoutCoder.PolylineAlgorithm.Tests.Encoding
1616
[TestCategory(nameof(PolylineEncoding))]
1717
public class PolylineEncodingTest : PolylineEncoding
1818
{
19-
#region Methods
20-
2119
/// <summary>
2220
/// The CreateResult_AreEqual
2321
/// </summary>
@@ -49,7 +47,5 @@ public void GetCoordinate_AreEqual()
4947
// Assert
5048
Assert.AreEqual(validCoordinate, result);
5149
}
52-
53-
#endregion
5450
}
5551
}

tests/PolylineAlgorithmTest.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ namespace DropoutCoder.PolylineAlgorithm.Tests
1818
[TestCategory(nameof(PolylineAlgorithm))]
1919
public class PolylineAlgorithmTest
2020
{
21-
#region Methods
22-
2321
/// <summary>
2422
/// Method is testing <see cref="PolylineAlgorithm.Decode(char[])" /> method. Empty <see langword="char"/>[] is passed as parameter.
2523
/// Expected result is <see cref="ArgumentException"/>.
@@ -171,7 +169,5 @@ public void Encode_ValidInput_AreEqual()
171169
// Assert
172170
Assert.AreEqual(Defaults.Polyline.Valid, result);
173171
}
174-
175-
#endregion
176172
}
177173
}

0 commit comments

Comments
 (0)