public void TestThirdDimension()
 {
     Assert.IsTrue(PolylineEncoderDecoder.GetThirdDimension("BFoz5xJ67i1BU") == ThirdDimension.Absent);
     Assert.IsTrue(PolylineEncoderDecoder.GetThirdDimension("BVoz5xJ67i1BU") == ThirdDimension.Level);
     Assert.IsTrue(PolylineEncoderDecoder.GetThirdDimension("BlBoz5xJ67i1BU") == ThirdDimension.Altitude);
     Assert.IsTrue(PolylineEncoderDecoder.GetThirdDimension("B1Boz5xJ67i1BU") == ThirdDimension.Elevation);
 }
        public void EncodedFlexilineMatchesDecodedResultTest()
        {
            using (var decodedEnumerator = File.ReadLines("../../../../../../test/round_half_up/decoded.txt").GetEnumerator())
            {
                foreach (var flexiline in File.ReadLines("../../../../../../test/round_half_up/encoded.txt"))
                {
                    decodedEnumerator.MoveNext();
                    var testResultStr = decodedEnumerator.Current;

                    var expectedResult = ParseExpectedTestResult(testResultStr);

                    var decoded = PolylineEncoderDecoder.Decode(flexiline);
                    var encoded = PolylineEncoderDecoder.Encode(
                        decoded,
                        expectedResult.Precision.Precision2d,
                        expectedResult.Precision.Type3d,
                        expectedResult.Precision.Precision3d);

                    ThirdDimension thirdDimension = PolylineEncoderDecoder.GetThirdDimension(encoded);
                    Assert.AreEqual(expectedResult.Precision.Type3d, thirdDimension);

                    for (int i = 0; i < decoded.Count; i++)
                    {
                        AssertEqualWithPrecision(
                            expectedResult.Coordinates[i].Lat,
                            decoded[i].Lat,
                            expectedResult.Precision.Precision2d);

                        AssertEqualWithPrecision(
                            expectedResult.Coordinates[i].Lng,
                            decoded[i].Lng,
                            expectedResult.Precision.Precision2d);

                        AssertEqualWithPrecision(
                            expectedResult.Coordinates[i].Z,
                            decoded[i].Z,
                            expectedResult.Precision.Precision3d);
                    }

                    if (flexiline != encoded)
                    {
                        Console.WriteLine($@"WARNING expected {flexiline} but got {encoded}");
                    }
                }
            }
        }