Skip to content
This repository was archived by the owner on Feb 9, 2025. It is now read-only.
Open
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
30 changes: 19 additions & 11 deletions PolylineEncoder.Net.sln
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
# Visual Studio 15
VisualStudioVersion = 15.0.26730.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{85E635ED-6B86-4A6E-A91C-D8FB551680AE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{617983B4-27C5-43E8-AED8-E7C101A1A86A}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
global.json = global.json
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "PolylineEncoder.Net", "src\PolylineEncoder.Net\PolylineEncoder.Net.xproj", "{7D1B865F-C26D-4C54-B6D7-DC3E2A49749F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{694420B5-3D4D-4CBA-A418-1D8BD96120BC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PolylineEncoder.Net", "src\PolylineEncoder.Net\PolylineEncoder.Net.csproj", "{C1FB0993-5199-4BFF-8717-8A4DEB098C29}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PolylineEncoder.Net.Tests", "test\PolylineEncoder.Net.Tests\PolylineEncoder.Net.Tests.csproj", "{09EBD7BE-FC2F-4283-9133-4E4F4B68B546}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7D1B865F-C26D-4C54-B6D7-DC3E2A49749F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D1B865F-C26D-4C54-B6D7-DC3E2A49749F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D1B865F-C26D-4C54-B6D7-DC3E2A49749F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D1B865F-C26D-4C54-B6D7-DC3E2A49749F}.Release|Any CPU.Build.0 = Release|Any CPU
{C1FB0993-5199-4BFF-8717-8A4DEB098C29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1FB0993-5199-4BFF-8717-8A4DEB098C29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1FB0993-5199-4BFF-8717-8A4DEB098C29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C1FB0993-5199-4BFF-8717-8A4DEB098C29}.Release|Any CPU.Build.0 = Release|Any CPU
{09EBD7BE-FC2F-4283-9133-4E4F4B68B546}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09EBD7BE-FC2F-4283-9133-4E4F4B68B546}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09EBD7BE-FC2F-4283-9133-4E4F4B68B546}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09EBD7BE-FC2F-4283-9133-4E4F4B68B546}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7D1B865F-C26D-4C54-B6D7-DC3E2A49749F} = {85E635ED-6B86-4A6E-A91C-D8FB551680AE}
{C1FB0993-5199-4BFF-8717-8A4DEB098C29} = {85E635ED-6B86-4A6E-A91C-D8FB551680AE}
{09EBD7BE-FC2F-4283-9133-4E4F4B68B546} = {694420B5-3D4D-4CBA-A418-1D8BD96120BC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3B2850B1-2113-4586-A7F6-5DB7FBA20C3A}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions PolylineEncoder.Net.v3.ncrunchsolution
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<SolutionConfiguration>
<Settings>
<AllowParallelTestExecution>False</AllowParallelTestExecution>
<SolutionConfigured>True</SolutionConfigured>
</Settings>
</SolutionConfiguration>
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

12 changes: 12 additions & 0 deletions src/PolylineEncoder.Net/PolylineEncoder.Net.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions src/PolylineEncoder.Net/PolylineEncoder.Net.v3.ncrunchproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ProjectConfiguration>
<Settings>
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully>
</Settings>
</ProjectConfiguration>
21 changes: 0 additions & 21 deletions src/PolylineEncoder.Net/PolylineEncoder.Net.xproj

This file was deleted.

21 changes: 0 additions & 21 deletions src/PolylineEncoder.Net/project.json

This file was deleted.

67 changes: 67 additions & 0 deletions test/PolylineEncder.Tests/PolylineEncder.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EB72B3BF-E2EC-45B1-BD69-848060E5AD66}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PolylineEncder.Tests</RootNamespace>
<AssemblyName>PolylineEncder.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="UnitTest1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" />
</Project>
20 changes: 20 additions & 0 deletions test/PolylineEncder.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("PolylineEncder.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PolylineEncder.Tests")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]

[assembly: Guid("eb72b3bf-e2ec-45b1-bd69-848060e5ad66")]

// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
14 changes: 14 additions & 0 deletions test/PolylineEncder.Tests/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace PolylineEncder.Tests
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
}
}
}
5 changes: 5 additions & 0 deletions test/PolylineEncder.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSTest.TestAdapter" version="1.1.18" targetFramework="net461" />
<package id="MSTest.TestFramework" version="1.1.18" targetFramework="net461" />
</packages>
43 changes: 43 additions & 0 deletions test/PolylineEncoder.Net.Tests/EncodingTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using NUnit.Framework;
using PolylineEncoder.Net.Models;
using PolylineEncoder.Net.Utility;
using System.Collections.Generic;
using System.Linq;

namespace PolylineEncoder.Tests
{
public class DecodeTests
{
[Test]
public void DecodeTest()
{
// arrange
var s = "sezbGuogHuAa@TmFgAeCrBsH|FaG~CHE{IrAPtFkKgF}h@rC{AMuG~FoBpFdNvDoGhDKpBfB~CnKlHmT`IDdB{Yk@}MyCkNjKrDM`DhElFxCvNt@sS|BhB~AeKhBaBqAqDqAV}AoF}Akd@}ByJpAc@JkLfAzPzAUKmf@rBgRn@KP|G|AxCvAuAMqBtAECqCnFsGaHcl@hC{AfAyNhF_IfDsKnGcGtRqC|MbG|AcCxFtHxAyCo@aIdAaA?aFkFuT`JaC~C|Eh@mLzMpCtCaC`@|EzC}HxGbMt@xH_AvAzFs@";
var utility = new PolylineUtility();

// act
IEnumerable<IGeoCoordinate> res = utility.Decode(s);

// assert
Assert.IsTrue(res != null);
Assert.IsTrue(res.ToList().Count > 0);
}

[Test]
public void EncodeTest()
{
// arrange
var expected = "_c`|@_c`|@";
var utility = new PolylineUtility();
var p = new GeoCoordinate(10.0, 10.0);

// act
var encoded = utility.Encode(p);

// assert
Assert.IsTrue(encoded != null);
Assert.IsTrue(encoded == expected);
}

}
}
59 changes: 59 additions & 0 deletions test/PolylineEncoder.Net.Tests/PolylineEncoder.Net.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{09EBD7BE-FC2F-4283-9133-4E4F4B68B546}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PolylineEncoder.Net.Tests</RootNamespace>
<AssemblyName>PolylineEncoder.Net.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=3.8.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="EncodingTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\PolylineEncoder.Net\PolylineEncoder.Net.csproj">
<Project>{c1fb0993-5199-4bff-8717-8a4deb098c29}</Project>
<Name>PolylineEncoder.Net</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PolylineEncoder.Net")]
[assembly: AssemblyTitle("PolylineEncoder.Net.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Fairfax Media")]
[assembly: AssemblyProduct("PolylineEncoder.Net")]
[assembly: AssemblyCopyright("Copyright © Fairfax Media 2016")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PolylineEncoder.Net.Tests")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -20,4 +20,17 @@
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7d1b865f-c26d-4c54-b6d7-dc3e2a49749f")]
[assembly: Guid("09ebd7be-fc2f-4283-9133-4e4f4b68b546")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
4 changes: 4 additions & 0 deletions test/PolylineEncoder.Net.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.8.1" targetFramework="net461" />
</packages>
Loading