Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// <copyright file="FileSourceTest.cs" company="Mapbox">
// Copyright (c) 2016 Mapbox. All rights reserved.
// </copyright>
Expand All @@ -10,20 +10,14 @@ namespace Mapbox.CheapRulerCs.UnitTest
{


using Mapbox.Platform;
using NUnit.Framework;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System;
using System.Linq;
using UnityEngine;
using Mapbox.CheapRulerCs;
using Mapbox.Json.Linq;

[TestFixture]
internal class ProbeExtractorCsTest
internal class CheapRulerCsTest
{


Expand Down Expand Up @@ -67,11 +61,8 @@ public void DistanceInMiles()

private List<line> loadFixtures()
{
string fixturePath = Application.dataPath + "/Mapbox/Core/cheap-ruler-cs/Tests/Editor/lines.json";
string fixtureAsText;
using (TextReader tw = new StreamReader(fixturePath, Encoding.UTF8)) { fixtureAsText = tw.ReadToEnd(); }

var json = JArray.Parse(fixtureAsText);
TextAsset fixturesAsset = Resources.Load<TextAsset>("ChearRulerCs_fixtures");
var json = JArray.Parse(fixturesAsset.text);
List<line> fixtures = new List<line>();

foreach (var line in json)
Expand All @@ -91,4 +82,4 @@ private List<line> loadFixtures()


}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,15 @@ public IAsyncRequest Query(DirectionResource direction, Action<DirectionsRespons
/// </summary>
/// <param name="str">JSON String.</param>
/// <returns>A <see cref="DirectionsResponse"/>.</returns>
internal DirectionsResponse Deserialize(string str)
public DirectionsResponse Deserialize(string str)
{
return JsonConvert.DeserializeObject<DirectionsResponse>(str, JsonConverters.Converters);
}

public string Serialize(DirectionsResponse response)
{
return JsonConvert.SerializeObject(response, JsonConverters.Converters);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public IAsyncRequest Geocode<T>(GeocodeResource<T> geocode, Action<ForwardGeocod
/// <param name="str">JSON String.</param>
/// <returns>A <see cref="GeocodeResponse"/>.</returns>
/// <typeparam name="T">Forward or reverse geocode. </typeparam>
internal T Deserialize<T>(string str)
public T Deserialize<T>(string str)
{
return JsonConvert.DeserializeObject<T>(str, JsonConverters.Converters);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Mapbox.Map
using System;
using Mapbox.Unity.Telemetry;

internal sealed class TileResource : IResource
public sealed class TileResource : IResource
{
readonly string _query;

Expand Down Expand Up @@ -65,7 +65,8 @@ public string GetUrl()
uriBuilder.Query = TelemetryFactory.EventQuery;
}

return uriBuilder.ToString();
//return uriBuilder.ToString();
return uriBuilder.Uri.ToString();
}
}
}

This file was deleted.

Loading