Skip to content

Commit dab30e1

Browse files
committed
added const tests
1 parent 141259e commit dab30e1

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

tests/PolylineAlgorithm.Abstraction.Tests/PolylineEncoderTest.cs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ public class PolylineEncoderTest {
1010

1111
public static IEnumerable<object[]> CoordinateCount => [[1], [10], [100], [1_000]];
1212

13+
[TestMethod]
14+
public void Constructor_Parameterless_Ok() {
15+
// Arrange && Act
16+
var encoder = new PolylineEncoder();
17+
// Assert
18+
Assert.IsNotNull(encoder);
19+
Assert.IsNotNull(encoder.Options);
20+
}
21+
22+
[TestMethod]
23+
public void Constructor_ValidOptions_Ok() {
24+
// Arrange
25+
var options = new PolylineEncodingOptions();
26+
// Act
27+
var encoder = new PolylineEncoder(options);
28+
// Assert
29+
Assert.IsNotNull(encoder);
30+
Assert.AreSame(options, encoder.Options);
31+
}
32+
1333
[TestMethod]
1434
public void Encode_NullCoordinates_Throws_ArgumentException() {
1535
// Arrange
@@ -67,7 +87,10 @@ public void Encode_StaticValue_ValidInput_Ok() {
6787

6888
public class PolylineEncoder : PolylineEncoder<(double Latitude, double Longitude), string> {
6989
public PolylineEncoder()
70-
: base(new()) { }
90+
: base() { }
91+
92+
public PolylineEncoder(PolylineEncodingOptions options)
93+
: base(options) { }
7194

7295
protected override string CreatePolyline(ReadOnlyMemory<char> polyline) => polyline.ToString();
7396
protected override double GetLatitude((double Latitude, double Longitude) coordinate) => coordinate.Latitude;

0 commit comments

Comments
 (0)