diff --git a/src/PolylineAlgorithm/Abstraction/IPolylineDecoder.cs b/src/PolylineAlgorithm/Abstraction/IPolylineDecoder.cs index eb57148c..f6f1cb5a 100644 --- a/src/PolylineAlgorithm/Abstraction/IPolylineDecoder.cs +++ b/src/PolylineAlgorithm/Abstraction/IPolylineDecoder.cs @@ -9,19 +9,19 @@ namespace PolylineAlgorithm.Abstraction; using System.Threading; /// -/// Defines a contract for decoding an encoded polyline into a sequence of geographic coordinates. +/// Defines a contract for decoding an encoded polyline into a sequence of values. /// /// /// The type that represents the encoded polyline input. Common implementations use , /// but custom wrapper types are allowed to carry additional metadata. /// /// -/// The coordinate type returned by the decoder. Typical implementations return a struct or class that +/// The value type returned by the decoder. Typical implementations return a struct or class that /// contains latitude and longitude (for example a LatLng type or a ValueTuple<double,double>). /// public interface IPolylineDecoder { /// - /// Decodes the specified encoded polyline into an ordered sequence of geographic coordinates. + /// Decodes the specified encoded polyline into an ordered sequence of values. /// The sequence preserves the original vertex order encoded by the . /// /// @@ -35,7 +35,7 @@ public interface IPolylineDecoder { /// /// /// An of representing the decoded - /// latitude/longitude pairs (or equivalent coordinates) in the same order they were encoded. + /// latitude/longitude pairs (or equivalent values) in the same order they were encoded. /// /// /// Implementations commonly follow the Google Encoded Polyline Algorithm Format, but this interface diff --git a/src/PolylineAlgorithm/Abstraction/IPolylineEncoder.cs b/src/PolylineAlgorithm/Abstraction/IPolylineEncoder.cs index 724f4f73..bc16b5ab 100644 --- a/src/PolylineAlgorithm/Abstraction/IPolylineEncoder.cs +++ b/src/PolylineAlgorithm/Abstraction/IPolylineEncoder.cs @@ -5,12 +5,12 @@ namespace PolylineAlgorithm.Abstraction; /// -/// Contract for encoding a sequence of geographic coordinates into an encoded polyline representation. +/// Contract for encoding a sequence of values into an encoded polyline representation. /// Implementations interpret the generic type and produce an encoded -/// representation of those coordinates as . +/// representation of those values as . /// /// -/// The concrete coordinate representation used by the encoder (for example a struct or class containing +/// The concrete value representation used by the encoder (for example a struct or class containing /// Latitude and Longitude values). Implementations must document the expected shape, /// units (typically decimal degrees), and any required fields for . /// Common shapes: @@ -27,16 +27,16 @@ namespace PolylineAlgorithm.Abstraction; /// - This interface is intentionally minimal to allow different encoding strategies (Google encoded polyline, /// precision/scale variants, or custom compressed formats) to be expressed behind a common contract. /// - Implementations should document: -/// - Coordinate precision and rounding rules (for example 1e-5 for 5-decimal precision). -/// - Coordinate ordering and whether altitude or additional dimensions are supported. +/// - Value precision and rounding rules (for example 1e-5 for 5-decimal precision). +/// - Value ordering and whether altitude or additional dimensions are supported. /// - Thread-safety guarantees: whether instances are safe to reuse concurrently or must be instantiated per-call. /// - Implementations are encouraged to be memory-efficient; the API accepts a /// to avoid forced allocations when callers already have contiguous memory. /// public interface IPolylineEncoder { /// - /// Encodes a sequence of geographic coordinates into an encoded polyline representation. - /// The order of coordinates in is preserved in the encoded result. + /// Encodes a sequence of values into an encoded polyline representation. + /// The order of values in is preserved in the encoded result. /// /// /// The collection of instances to encode into a polyline. @@ -49,24 +49,24 @@ public interface IPolylineEncoder { /// when cancellation is requested. For fast, in-memory encoders cancellation may be best-effort. /// /// - /// A containing the encoded polyline that represents the input coordinates. + /// A containing the encoded polyline that represents the input values. /// The exact format and any delimiting/terminating characters are implementation-specific and must be /// documented by concrete encoder types. /// /// /// /// // Example pseudocode for typical usage with a string-based encoder: - /// var coords = new[] { - /// new Coordinate { Latitude = 47.6219, Longitude = -122.3503 }, - /// new Coordinate { Latitude = 47.6220, Longitude = -122.3504 } + /// var values = new[] { + /// new Value { Latitude = 47.6219, Longitude = -122.3503 }, + /// new Value { Latitude = 47.6220, Longitude = -122.3504 } /// }; - /// IPolylineEncoder<Coordinate,string> encoder = new GoogleEncodedPolylineEncoder(); - /// string encoded = encoder.Encode(coords, CancellationToken.None); + /// IPolylineEncoder<Value,string> encoder = new GoogleEncodedPolylineEncoder(); + /// string encoded = encoder.Encode(values, CancellationToken.None); /// /// /// /// - Implementations should validate input as appropriate and document any preconditions (for example - /// if coordinates must be within [-90,90] latitude and [-180,180] longitude). + /// if values must be within [-90,90] latitude and [-180,180] longitude). /// - For large input sequences, implementations may provide streaming or incremental encoders; those /// variants can still implement this interface by materializing the final encoded result. /// diff --git a/src/PolylineAlgorithm/Abstraction/IPolylineFormatter.cs b/src/PolylineAlgorithm/Abstraction/IPolylineFormatter.cs index c88a4aab..55b4765e 100644 --- a/src/PolylineAlgorithm/Abstraction/IPolylineFormatter.cs +++ b/src/PolylineAlgorithm/Abstraction/IPolylineFormatter.cs @@ -13,7 +13,7 @@ namespace PolylineAlgorithm.Abstraction; /// produce a from an encoded character buffer, and extract that buffer /// back from a . /// -/// The coordinate or item type. For example a struct with Latitude/Longitude. +/// The value or item type. For example a struct with Latitude/Longitude. /// The polyline surface type. For example or /// of . /// diff --git a/src/PolylineAlgorithm/Extensions/PolylineEncoderExtensions.cs b/src/PolylineAlgorithm/Extensions/PolylineEncoderExtensions.cs index 460eb99b..b136c146 100644 --- a/src/PolylineAlgorithm/Extensions/PolylineEncoderExtensions.cs +++ b/src/PolylineAlgorithm/Extensions/PolylineEncoderExtensions.cs @@ -10,13 +10,13 @@ namespace PolylineAlgorithm.Extensions; using System; /// -/// Provides extension methods for the interface to facilitate encoding geographic coordinates into polylines. +/// Provides extension methods for the interface to facilitate encoding values into polylines. /// public static class PolylineEncoderExtensions { /// /// Encodes an array of instances into an encoded polyline. /// - /// The type that represents a geographic coordinate to encode. + /// The type that represents a value to encode. /// The type that represents the encoded polyline output. /// /// The instance used to perform the encoding operation. @@ -25,7 +25,7 @@ public static class PolylineEncoderExtensions { /// The array of objects to encode. /// /// - /// A instance representing the encoded polyline for the provided coordinates. + /// A instance representing the encoded polyline for the provided values. /// /// /// Thrown when or is . diff --git a/src/PolylineAlgorithm/FormatterBuilder.cs b/src/PolylineAlgorithm/FormatterBuilder.cs index 8ea32dea..987c3cf3 100644 --- a/src/PolylineAlgorithm/FormatterBuilder.cs +++ b/src/PolylineAlgorithm/FormatterBuilder.cs @@ -12,7 +12,7 @@ namespace PolylineAlgorithm; /// /// Provides a fluent builder for constructing a . /// -/// The coordinate or item type from which column values are extracted. +/// The value or item type from which column values are extracted. /// The polyline surface type produced and consumed by the formatter. /// /// diff --git a/src/PolylineAlgorithm/Internal/Defaults.cs b/src/PolylineAlgorithm/Internal/Defaults.cs index 429676bd..a5e62623 100644 --- a/src/PolylineAlgorithm/Internal/Defaults.cs +++ b/src/PolylineAlgorithm/Internal/Defaults.cs @@ -11,7 +11,7 @@ namespace PolylineAlgorithm.Internal; /// Provides default values and constants used throughout the Polyline Algorithm. /// /// -/// Organizes defaults for algorithm parameters, polyline encoding, and geographic coordinates into nested static classes. +/// Organizes defaults for algorithm parameters, polyline encoding, and geographic values into nested static classes. /// [ExcludeFromCodeCoverage] internal static class Defaults { @@ -51,9 +51,9 @@ internal static class Algorithm { } /// - /// Contains default values and constants for geographic coordinate validation. + /// Contains default values and constants for geographic value validation. /// - internal static class Coordinate { + internal static class Value { /// /// Provides constants representing latitude values, including the default, minimum, and maximum valid values. /// diff --git a/src/PolylineAlgorithm/Internal/Diagnostics/ExceptionGuard.cs b/src/PolylineAlgorithm/Internal/Diagnostics/ExceptionGuard.cs index 208584ee..f09d79c1 100644 --- a/src/PolylineAlgorithm/Internal/Diagnostics/ExceptionGuard.cs +++ b/src/PolylineAlgorithm/Internal/Diagnostics/ExceptionGuard.cs @@ -70,20 +70,20 @@ internal static void ThrowBufferOverflow(string message) { } /// - /// Throws an when a coordinate value is outside the allowed range. + /// Throws an when a value is outside the allowed range. /// - /// The coordinate value that was out of range. + /// The value that was out of range. /// Inclusive minimum allowed value. /// Inclusive maximum allowed value. - /// Name of the parameter containing the coordinate. + /// Name of the parameter containing the value. #if NET6_0_OR_GREATER [StackTraceHidden] #else [MethodImpl(MethodImplOptions.NoInlining)] #endif [DoesNotReturn] - internal static void ThrowCoordinateValueOutOfRange(double value, double min, double max, string paramName) { - throw new ArgumentOutOfRangeException(paramName, ExceptionMessage.FormatCoordinateValueMustBeBetween(paramName, min, max)); + internal static void ThrowValueOutOfRange(double value, double min, double max, string paramName) { + throw new ArgumentOutOfRangeException(paramName, ExceptionMessage.FormatValueMustBeBetween(paramName, min, max)); } /// @@ -269,9 +269,9 @@ internal static string FormatMalformedPolyline(long position) => string.Format(CultureInfo.InvariantCulture, PolylineIsMalformedAtFormat, position); /// - /// Formats a message indicating a coordinate parameter must be within a range. + /// Formats a message indicating a value parameter must be within a range. /// - internal static string FormatCoordinateValueMustBeBetween(string name, double min, double max) => + internal static string FormatValueMustBeBetween(string name, double min, double max) => string.Format(CultureInfo.InvariantCulture, CoordinateValueMustBeBetweenFormat, name, min, max); /// diff --git a/src/PolylineAlgorithm/Internal/Diagnostics/LogDebugExtensions.cs b/src/PolylineAlgorithm/Internal/Diagnostics/LogDebugExtensions.cs index cc58c702..5353ef88 100644 --- a/src/PolylineAlgorithm/Internal/Diagnostics/LogDebugExtensions.cs +++ b/src/PolylineAlgorithm/Internal/Diagnostics/LogDebugExtensions.cs @@ -46,12 +46,12 @@ internal static partial class LogDebugExtensions { internal static partial void LogOperationFinishedDebug(this ILogger logger, string operationName); /// - /// Logs a debug message containing the decoded coordinate values and position. + /// Logs a debug message containing the decoded values and position. /// /// The used to write the log entry. /// The decoded latitude value. /// The decoded longitude value. - /// The position in the polyline buffer at which the coordinate was decoded. - [LoggerMessage(EVENT_ID_BASE + 4, LOG_LEVEL, "Decoded coordinate: (Latitude: {latitude}, Longitude: {longitude}) at position {position}.")] + /// The position in the polyline buffer at which the value was decoded. + [LoggerMessage(EVENT_ID_BASE + 4, LOG_LEVEL, "Decoded value: (Latitude: {latitude}, Longitude: {longitude}) at position {position}.")] internal static partial void LogDecodedCoordinateDebug(this ILogger logger, double latitude, double longitude, int position); } diff --git a/src/PolylineAlgorithm/Internal/Diagnostics/LogWarningExtensions.cs b/src/PolylineAlgorithm/Internal/Diagnostics/LogWarningExtensions.cs index 6f5e5d5f..44067bd5 100644 --- a/src/PolylineAlgorithm/Internal/Diagnostics/LogWarningExtensions.cs +++ b/src/PolylineAlgorithm/Internal/Diagnostics/LogWarningExtensions.cs @@ -60,9 +60,9 @@ internal static partial class LogWarningExtensions { /// /// The used to write the log entry. /// The buffer position where the write was attempted. - /// The index of the current coordinate that prevented the write. - [LoggerMessage(EVENT_ID_BASE + 4, LOG_LEVEL, "Cannot write to internal buffer at position {position}. Current coordinate is at index {coordinateIndex}.")] - internal static partial void LogCannotWriteValueToBufferWarning(this ILogger logger, int position, int coordinateIndex); + /// The index of the current value that prevented the write. + [LoggerMessage(EVENT_ID_BASE + 4, LOG_LEVEL, "Cannot write to internal buffer at position {position}. Current value is at index {valueIndex}.")] + internal static partial void LogCannotWriteValueToBufferWarning(this ILogger logger, int position, int valueIndex); /// /// Logs a warning when a polyline is shorter than the minimal required length. diff --git a/src/PolylineAlgorithm/PolylineDecoder.cs b/src/PolylineAlgorithm/PolylineDecoder.cs index 7d9a3193..7faf3a5c 100644 --- a/src/PolylineAlgorithm/PolylineDecoder.cs +++ b/src/PolylineAlgorithm/PolylineDecoder.cs @@ -15,10 +15,10 @@ namespace PolylineAlgorithm; using System.Threading; /// -/// Decodes encoded polyline representations into sequences of geographic coordinates. +/// Decodes encoded polyline representations into sequences of values. /// /// The type that represents the encoded polyline input. -/// The type that represents a decoded geographic coordinate. +/// The type that represents a decoded value. /// /// Pass a that carries a /// to the constructor. The formatter handles @@ -64,7 +64,7 @@ public PolylineDecoder(PolylineOptions options) { /// A token that can be used to cancel the operation. /// /// An of representing the decoded - /// coordinates. + /// values. /// /// /// Thrown when is . diff --git a/src/PolylineAlgorithm/PolylineEncoder.cs b/src/PolylineAlgorithm/PolylineEncoder.cs index 8c59d895..703575c0 100644 --- a/src/PolylineAlgorithm/PolylineEncoder.cs +++ b/src/PolylineAlgorithm/PolylineEncoder.cs @@ -16,9 +16,9 @@ namespace PolylineAlgorithm; using System.Threading; /// -/// Encodes sequences of geographic coordinates into encoded polyline representations. +/// Encodes sequences of values into encoded polyline representations. /// -/// The type that represents a geographic coordinate to encode. +/// The type that represents a value to encode. /// The type that represents the encoded polyline output. /// /// Pass a that carries a @@ -55,10 +55,10 @@ public PolylineEncoder(PolylineOptions options) { /// Encodes a collection of instances into an encoded /// . /// - /// The collection of coordinates to encode. + /// The collection of values to encode. /// A token that can be used to cancel the operation. /// - /// An instance of representing the encoded coordinates. + /// An instance of representing the encoded values. /// /// /// Thrown when is empty. @@ -135,7 +135,7 @@ public TPolyline Encode(ReadOnlySpan coordinates, CancellationToken canc /// delta baseline. Use this overload to encode large sequences in independent chunks that can be /// concatenated into a single valid polyline. /// - /// The collection of coordinates to encode. + /// The collection of values to encode. /// /// Per-call options that control the starting delta baseline. Pass or an /// instance with set to @@ -144,7 +144,7 @@ public TPolyline Encode(ReadOnlySpan coordinates, CancellationToken canc /// /// A token that can be used to cancel the operation. /// - /// An instance of representing the encoded coordinates. + /// An instance of representing the encoded values. /// /// /// Thrown when is empty. diff --git a/src/PolylineAlgorithm/PolylineEncoding.cs b/src/PolylineAlgorithm/PolylineEncoding.cs index f91af382..4eeb4079 100644 --- a/src/PolylineAlgorithm/PolylineEncoding.cs +++ b/src/PolylineAlgorithm/PolylineEncoding.cs @@ -14,19 +14,19 @@ namespace PolylineAlgorithm; /// /// Provides methods for encoding and decoding polyline data, as well as utilities for normalizing and de-normalizing -/// geographic coordinate values. +/// values. /// /// The class includes functionality for working with encoded polyline -/// data, such as reading and writing encoded values, as well as methods for normalizing and de-normalizing geographic -/// coordinates. It also provides validation utilities to ensure values conform to expected ranges for latitude and +/// data, such as reading and writing encoded values, as well as methods for normalizing and de-normalizing +/// values. It also provides validation utilities to ensure values conform to expected ranges for latitude and /// longitude. public static class PolylineEncoding { /// - /// Normalizes a geographic coordinate value to an integer representation based on the specified precision. + /// Normalizes a value to an integer representation based on the specified precision. /// /// /// - /// This method converts a floating-point coordinate value into a normalized integer by multiplying it by 10 raised + /// This method converts a floating-point value into a normalized integer by multiplying it by 10 raised /// to the power of the specified precision, then truncating the result to an integer. /// /// @@ -81,7 +81,7 @@ public static long Normalize(double value, uint precision = 5) { } /// - /// Converts a normalized integer coordinate value back to its floating-point representation based on the specified precision. + /// Converts a normalized integer value back to its floating-point representation based on the specified precision. /// /// /// @@ -111,7 +111,7 @@ public static long Normalize(double value, uint precision = 5) { /// The number of decimal places used during normalization. Default is 5, matching standard polyline encoding precision. /// /// - /// The denormalized floating-point coordinate value. + /// The denormalized floating-point value. /// /// /// Thrown if the arithmetic operation overflows during conversion. @@ -213,12 +213,12 @@ public static bool TryReadValue(ref long delta, ReadOnlyMemory buffer, ref /// If the buffer does not have enough remaining capacity, the method returns without modifying the buffer or position. /// /// - /// This method is the inverse of and can be used to encode coordinate deltas for polyline serialization. + /// This method is the inverse of and can be used to encode value deltas for polyline serialization. /// /// /// /// The long value to encode and write to the buffer. This value typically represents the difference between consecutive - /// coordinate values in polyline encoding. + /// values in polyline encoding. /// /// /// The destination buffer where the encoded characters will be written. Must have sufficient capacity to hold the encoded value. @@ -287,7 +287,7 @@ public static bool TryWriteValue(long delta, Span buffer, ref int position /// /// /// The long delta value to calculate the encoded size for. This value typically represents the difference between - /// consecutive coordinate values in polyline encoding. + /// consecutive values in polyline encoding. /// /// /// The number of characters required to encode the specified delta value. The minimum return value is 1. diff --git a/src/PolylineAlgorithm/PolylineEncodingOptions.cs b/src/PolylineAlgorithm/PolylineEncodingOptions.cs index ef3f9dca..9f7aff11 100644 --- a/src/PolylineAlgorithm/PolylineEncodingOptions.cs +++ b/src/PolylineAlgorithm/PolylineEncodingOptions.cs @@ -8,7 +8,7 @@ namespace PolylineAlgorithm; /// /// Per-call options for a chunked encoding operation. /// -/// The coordinate type understood by the formatter. +/// The value type understood by the formatter. /// /// Pass an instance of this class to the chunked /// overload to control @@ -21,16 +21,16 @@ public sealed class PolylineEncodingOptions { /// /// Initializes a new instance of with no - /// previous coordinate (formatter default baseline will be used). + /// previous value (formatter default baseline will be used). /// public PolylineEncodingOptions() { } /// /// Initializes a new instance of with the - /// specified previous coordinate used to seed the delta baseline. + /// specified previous value used to seed the delta baseline. /// /// - /// The last coordinate of the previous chunk, used to seed the delta baseline. + /// The last value of the previous chunk, used to seed the delta baseline. /// public PolylineEncodingOptions(TValue previous) { _previous = previous; @@ -38,7 +38,7 @@ public PolylineEncodingOptions(TValue previous) { } /// - /// Gets a value indicating whether a previous coordinate has been supplied to seed the delta + /// Gets a value indicating whether a previous value has been supplied to seed the delta /// baseline. When the formatter's built-in baseline is used as the /// starting point (which defaults to zero when no baseline has been configured), equivalent to /// the existing default behaviour. @@ -46,7 +46,7 @@ public PolylineEncodingOptions(TValue previous) { public bool HasPrevious { get; } /// - /// Gets the last coordinate of the previous chunk, used to seed the delta baseline. + /// Gets the last value of the previous chunk, used to seed the delta baseline. /// Only meaningful when is . /// public TValue Previous => _previous; diff --git a/src/PolylineAlgorithm/PolylineFormatter.cs b/src/PolylineAlgorithm/PolylineFormatter.cs index a183b6ad..03be15d2 100644 --- a/src/PolylineAlgorithm/PolylineFormatter.cs +++ b/src/PolylineAlgorithm/PolylineFormatter.cs @@ -13,7 +13,7 @@ namespace PolylineAlgorithm; /// /// A sealed, immutable formatter that implements . /// -/// The coordinate or item type. +/// The value or item type. /// The polyline surface type. /// /// Instances are constructed exclusively through . diff --git a/src/PolylineAlgorithm/PolylineItemFactory.cs b/src/PolylineAlgorithm/PolylineItemFactory.cs index 7a694416..75178d9b 100644 --- a/src/PolylineAlgorithm/PolylineItemFactory.cs +++ b/src/PolylineAlgorithm/PolylineItemFactory.cs @@ -11,7 +11,7 @@ namespace PolylineAlgorithm; /// Represents a factory method that reconstructs a item from denormalized /// values decoded from a polyline. /// -/// The coordinate or item type to create. +/// The value or item type to create. /// /// The denormalized values reconstructed by the polyline decoder. Each element corresponds to the /// original value that was encoded, with the precision factor divided out and any diff --git a/src/PolylineAlgorithm/PolylineOptions.cs b/src/PolylineAlgorithm/PolylineOptions.cs index 0bdce089..d3332413 100644 --- a/src/PolylineAlgorithm/PolylineOptions.cs +++ b/src/PolylineAlgorithm/PolylineOptions.cs @@ -13,7 +13,7 @@ namespace PolylineAlgorithm; /// /// Provides unified configuration for a formatter-driven encoding or decoding operation. /// -/// The coordinate or item type understood by the formatter. +/// The value or item type understood by the formatter. /// The polyline surface type understood by the formatter. /// /// Supply an and optional settings, diff --git a/tests/PolylineAlgorithm.Tests/Extensions/PolylineEncoderExtensionsTests.cs b/tests/PolylineAlgorithm.Tests/Extensions/PolylineEncoderExtensionsTests.cs index c72a1568..08cee491 100644 --- a/tests/PolylineAlgorithm.Tests/Extensions/PolylineEncoderExtensionsTests.cs +++ b/tests/PolylineAlgorithm.Tests/Extensions/PolylineEncoderExtensionsTests.cs @@ -59,7 +59,7 @@ public void Encode_With_Array_Null_Coordinates_Throws_ArgumentNullException() { // Act & Assert ArgumentNullException ex = Assert.ThrowsExactly( () => PolylineEncoderExtensions.Encode<(double, double), string>(encoder, coordinates!)); - Assert.AreEqual("coordinates", ex.ParamName); + Assert.AreEqual("values", ex.ParamName); } /// diff --git a/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/ExceptionGuardTests.cs b/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/ExceptionGuardTests.cs index b49e719a..6ea32650 100644 --- a/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/ExceptionGuardTests.cs +++ b/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/ExceptionGuardTests.cs @@ -54,10 +54,10 @@ public void ThrowBufferOverflow_With_Message_Throws_OverflowException() { } /// - /// Tests that ThrowCoordinateValueOutOfRange throws ArgumentOutOfRangeException with correct parameter name. + /// Tests that ThrowValueOutOfRange throws ArgumentOutOfRangeException with correct parameter name. /// [TestMethod] - public void ThrowCoordinateValueOutOfRange_With_Parameters_Throws_ArgumentOutOfRangeException() { + public void ThrowValueOutOfRange_With_Parameters_Throws_ArgumentOutOfRangeException() { // Arrange const double value = 100.0; const double min = -90.0; @@ -65,7 +65,7 @@ public void ThrowCoordinateValueOutOfRange_With_Parameters_Throws_ArgumentOutOfR const string paramName = "latitude"; // Act & Assert - var ex = Assert.ThrowsExactly(() => ExceptionGuard.ThrowCoordinateValueOutOfRange(value, min, max, paramName)); + var ex = Assert.ThrowsExactly(() => ExceptionGuard.ThrowValueOutOfRange(value, min, max, paramName)); Assert.AreEqual(paramName, ex.ParamName); Assert.IsNotNull(ex.Message); } @@ -288,17 +288,17 @@ public void FormatMalformedPolyline_With_Large_Position_Returns_Formatted_Messag } /// - /// Tests that FormatCoordinateValueMustBeBetween returns formatted message with all parameters. + /// Tests that FormatValueMustBeBetween returns formatted message with all parameters. /// [TestMethod] - public void FormatCoordinateValueMustBeBetween_With_Parameters_Returns_Formatted_Message() { + public void FormatValueMustBeBetween_With_Parameters_Returns_Formatted_Message() { // Arrange const string name = "latitude"; const double min = -90.0; const double max = 90.0; // Act - string result = ExceptionGuard.ExceptionMessage.FormatCoordinateValueMustBeBetween(name, min, max); + string result = ExceptionGuard.ExceptionMessage.FormatValueMustBeBetween(name, min, max); // Assert Assert.IsNotNull(result); @@ -308,17 +308,17 @@ public void FormatCoordinateValueMustBeBetween_With_Parameters_Returns_Formatted } /// - /// Tests that FormatCoordinateValueMustBeBetween with positive values returns formatted message. + /// Tests that FormatValueMustBeBetween with positive values returns formatted message. /// [TestMethod] - public void FormatCoordinateValueMustBeBetween_With_Positive_Values_Returns_Formatted_Message() { + public void FormatValueMustBeBetween_With_Positive_Values_Returns_Formatted_Message() { // Arrange const string name = "longitude"; const double min = 0.0; const double max = 180.0; // Act - string result = ExceptionGuard.ExceptionMessage.FormatCoordinateValueMustBeBetween(name, min, max); + string result = ExceptionGuard.ExceptionMessage.FormatValueMustBeBetween(name, min, max); // Assert Assert.IsNotNull(result); @@ -328,17 +328,17 @@ public void FormatCoordinateValueMustBeBetween_With_Positive_Values_Returns_Form } /// - /// Tests that FormatCoordinateValueMustBeBetween with fractional values returns formatted message. + /// Tests that FormatValueMustBeBetween with fractional values returns formatted message. /// [TestMethod] - public void FormatCoordinateValueMustBeBetween_With_Fractional_Values_Returns_Formatted_Message() { + public void FormatValueMustBeBetween_With_Fractional_Values_Returns_Formatted_Message() { // Arrange const string name = "value"; const double min = 1.5; const double max = 10.75; // Act - string result = ExceptionGuard.ExceptionMessage.FormatCoordinateValueMustBeBetween(name, min, max); + string result = ExceptionGuard.ExceptionMessage.FormatValueMustBeBetween(name, min, max); // Assert Assert.IsNotNull(result); diff --git a/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/LogDebugExtensionsTests.cs b/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/LogDebugExtensionsTests.cs index 0dff7193..e82d31a2 100644 --- a/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/LogDebugExtensionsTests.cs +++ b/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/LogDebugExtensionsTests.cs @@ -93,7 +93,7 @@ public void LogDecodedCoordinateDebug_With_Coordinates_And_Position_Logs_Decoded Assert.HasCount(1, logger.Logs); Assert.AreEqual(LogLevel.Debug, logger.Logs[0].Level); - Assert.Contains(string.Create(CultureInfo.InvariantCulture, $"Decoded coordinate: (Latitude: {latitude}, Longitude: {longitude}) at position {position}."), logger.Logs[0].Message, StringComparison.Ordinal); + Assert.Contains(string.Create(CultureInfo.InvariantCulture, $"Decoded value: (Latitude: {latitude}, Longitude: {longitude}) at position {position}."), logger.Logs[0].Message, StringComparison.Ordinal); } /// @@ -155,7 +155,7 @@ public void LogDecodedCoordinateDebug_With_Zero_Coordinates_Logs_Message() { Assert.HasCount(1, logger.Logs); Assert.AreEqual(LogLevel.Debug, logger.Logs[0].Level); - Assert.Contains("Decoded coordinate", logger.Logs[0].Message, StringComparison.Ordinal); + Assert.Contains("Decoded value", logger.Logs[0].Message, StringComparison.Ordinal); } /// diff --git a/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/LogWarningExtensionsTests.cs b/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/LogWarningExtensionsTests.cs index 5f19cc8e..a0693486 100644 --- a/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/LogWarningExtensionsTests.cs +++ b/tests/PolylineAlgorithm.Tests/Internal/Diagnostics/LogWarningExtensionsTests.cs @@ -69,7 +69,7 @@ public void LogInternalBufferOverflowWarning_Logs_Expected_Message() { public void LogCannotWriteValueToBufferWarning_Logs_Expected_Message() { var logger = new TestLogger(); logger.LogCannotWriteValueToBufferWarning(4, 5); - Assert.IsTrue(logger.Logs.Exists(l => l.Message.Contains("Cannot write to internal buffer at position 4. Current coordinate is at index 5.", StringComparison.Ordinal))); + Assert.IsTrue(logger.Logs.Exists(l => l.Message.Contains("Cannot write to internal buffer at position 4. Current value is at index 5.", StringComparison.Ordinal))); } ///