Skip to content

Commit

Permalink
Merge pull request #4 from GhostwareDev/development
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
kevingoos authored Feb 13, 2017
2 parents dd56df2 + 21c7441 commit e932991
Show file tree
Hide file tree
Showing 14 changed files with 209 additions and 145 deletions.
6 changes: 0 additions & 6 deletions GPS.NET/GPS.NET.Console/App.config

This file was deleted.

60 changes: 0 additions & 60 deletions GPS.NET/GPS.NET.Console/GPS.NET.Console.csproj

This file was deleted.

15 changes: 0 additions & 15 deletions GPS.NET/GPS.NET.Console/Program.cs

This file was deleted.

36 changes: 0 additions & 36 deletions GPS.NET/GPS.NET.Console/Properties/AssemblyInfo.cs

This file was deleted.

8 changes: 8 additions & 0 deletions GPS.NET/GPS.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ghostware.GPS.NET.GPSDWpfAp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ghostware.GPS.NET.WindowsAPI.Console", "Ghostware.GPS.NET.WindowsAPI.Console\Ghostware.GPS.NET.WindowsAPI.Console.csproj", "{B676527F-B0E6-4758-8498-AB37A8CE97C7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ghostware.GPS.NET.UnitTests", "Ghostware.GPS.NET.UnitTests\Ghostware.GPS.NET.UnitTests.csproj", "{53670C74-EF59-43EC-8521-219EF5A95D1D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -42,6 +44,12 @@ Global
{B676527F-B0E6-4758-8498-AB37A8CE97C7}.Release|Any CPU.Build.0 = Release|Any CPU
{B676527F-B0E6-4758-8498-AB37A8CE97C7}.RemoteDebug|Any CPU.ActiveCfg = RemoteDebug|Any CPU
{B676527F-B0E6-4758-8498-AB37A8CE97C7}.RemoteDebug|Any CPU.Build.0 = RemoteDebug|Any CPU
{53670C74-EF59-43EC-8521-219EF5A95D1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53670C74-EF59-43EC-8521-219EF5A95D1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53670C74-EF59-43EC-8521-219EF5A95D1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53670C74-EF59-43EC-8521-219EF5A95D1D}.Release|Any CPU.Build.0 = Release|Any CPU
{53670C74-EF59-43EC-8521-219EF5A95D1D}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU
{53670C74-EF59-43EC-8521-219EF5A95D1D}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
17 changes: 8 additions & 9 deletions GPS.NET/Ghostware.GPS.NET.GPSDConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ static void Main(string[] args)

var info = new GpsdInfo()
{
Address = "***.* **.* **.***",
//Default
//Port = 2947,
//IsProxyEnabled = true,
//ProxyAddress = "proxy",
//ProxyPort = 80,
//IsProxyAuthManual = true,
//ProxyUsername = "*****",
//ProxyPassword = "*****"
Address = "178.50.250.33",
Port = 2947,
IsProxyEnabled = true,
ProxyAddress = "proxy",
ProxyPort = 80,
IsProxyAuthManual = true,
ProxyUsername = "EXJ508",
ProxyPassword = "Xlssx534"
};
_gpsService = new GpsService(info);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
using System;
using Ghostware.GPS.NET.Enums;
using Ghostware.GPS.NET.Exceptions;
using Ghostware.GPS.NET.Factories;
using Ghostware.GPS.NET.GpsClients;
using Ghostware.GPS.NET.Models.ConnectionInfo;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Ghostware.GPS.NET.UnitTests.Factories
{
[TestClass]
public class GpsClientFactoryTests
{
#region Create by GpsType Tests

[TestMethod]
public void CreateComPortGpsTypeTest()
{
var result = GpsClientFactory.Create(GpsType.ComPort);
Assert.IsInstanceOfType(result, typeof(ComPortGpsClient));
}

[TestMethod]
public void CreateGpsdGpsTypeTest()
{
var result = GpsClientFactory.Create(GpsType.Gpsd);
Assert.IsInstanceOfType(result, typeof(GpsdGpsClient));
}

[TestMethod]
public void CreateFileGpsTypeTest()
{
var result = GpsClientFactory.Create(GpsType.File);
Assert.IsInstanceOfType(result, typeof(FileGpsClient));
}

[TestMethod]
public void CreateWindowsLocationApiGpsTypeTest()
{
var result = GpsClientFactory.Create(GpsType.WindowsLocationApi);
Assert.IsInstanceOfType(result, typeof(WindowsLocationApiGpsClient));
}

#endregion

#region Create by GpsInfo Tests

[TestMethod]
public void CreateComPortGpsInfoTest()
{
var result = GpsClientFactory.Create(new ComPortInfo());
Assert.IsInstanceOfType(result, typeof(ComPortGpsClient));
}

[TestMethod]
public void CreateGpsdGpsInfoTest()
{
var result = GpsClientFactory.Create(new GpsdInfo());
Assert.IsInstanceOfType(result, typeof(GpsdGpsClient));
}

[TestMethod]
public void CreateFileGpsInfoTest()
{
var result = GpsClientFactory.Create(new FileGpsInfo());
Assert.IsInstanceOfType(result, typeof(FileGpsClient));
}

[TestMethod]
public void CreateWindowsLocationApiGpsInfoTest()
{
var result = GpsClientFactory.Create(new WindowsLocationApiInfo());
Assert.IsInstanceOfType(result, typeof(WindowsLocationApiGpsClient));
}

[TestMethod]
[ExpectedException(typeof(UnknownTypeException))]
public void CreateUnkownGpsInfoTest()
{
GpsClientFactory.Create(new UnkownGpsInfo());
}

#endregion

[TestMethod]
[ExpectedException(typeof(NullReferenceException))]
public void CreateNullGpsTest()
{
GpsClientFactory.Create(null);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using Ghostware.GPS.NET.Enums;
using Ghostware.GPS.NET.Factories;
using Ghostware.GPS.NET.Models.ConnectionInfo;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Ghostware.GPS.NET.UnitTests.Factories
{
[TestClass]
public class GpsDataFactoryTests
{
#region Create GpsInfo Tests

[TestMethod]
public void CreateComPortGpsInfoTest()
{
var result = GpsDataFactory.Create(GpsType.ComPort);
Assert.IsInstanceOfType(result, typeof(ComPortInfo));
}

[TestMethod]
public void CreateGpsdGpsInfoTest()
{
var result = GpsDataFactory.Create(GpsType.Gpsd);
Assert.IsInstanceOfType(result, typeof(GpsdInfo));
}

[TestMethod]
public void CreateFileGpsInfoTest()
{
var result = GpsDataFactory.Create(GpsType.File);
Assert.IsInstanceOfType(result, typeof(FileGpsInfo));
}

[TestMethod]
public void CreateWindowsLocationApiGpsInfoTest()
{
var result = GpsDataFactory.Create(GpsType.WindowsLocationApi);
Assert.IsInstanceOfType(result, typeof(WindowsLocationApiInfo));
}

#endregion

#region GetDataType Tests

[TestMethod]
public void CreateComPortGpsInfoTypeTest()
{
var result = GpsDataFactory.GetDataType(GpsType.ComPort);
Assert.AreEqual(result, typeof(ComPortInfo));
}

[TestMethod]
public void CreateGpsdGpsInfoTypeTest()
{
var result = GpsDataFactory.GetDataType(GpsType.Gpsd);
Assert.AreEqual(result, typeof(GpsdInfo));
}

[TestMethod]
public void CreateFileGpsInfoTypeTest()
{
var result = GpsDataFactory.GetDataType(GpsType.File);
Assert.AreEqual(result, typeof(FileGpsInfo));
}

[TestMethod]
public void CreateWindowsLocationApiGpsInfoTypeTest()
{
var result = GpsDataFactory.GetDataType(GpsType.WindowsLocationApi);
Assert.AreEqual(result, typeof(WindowsLocationApiInfo));
}

#endregion
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Ghostware.GPS.NET.Models.ConnectionInfo;

namespace Ghostware.GPS.NET.UnitTests.Factories
{
public class UnkownGpsInfo : BaseGpsInfo
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{687F1BB3-0D9A-424D-B1FB-776C2157601E}</ProjectGuid>
<ProjectGuid>{53670C74-EF59-43EC-8521-219EF5A95D1D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Ghostware.GPS.NET.UnitTests</RootNamespace>
Expand Down Expand Up @@ -50,9 +50,17 @@
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="UnitTest1.cs" />
<Compile Include="Factories\GpsClientFactoryTests.cs" />
<Compile Include="Factories\GpsDataFactoryTests.cs" />
<Compile Include="Factories\UnkownGpsInfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ghostware.GPS.NET\Ghostware.GPS.NET.csproj">
<Project>{CFBDB710-C75D-4DDF-94D2-8855FA6F9F07}</Project>
<Name>Ghostware.GPS.NET</Name>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("687f1bb3-0d9a-424d-b1fb-776c2157601e")]
[assembly: Guid("53670c74-ef59-43ec-8521-219ef5a95d1d")]

// Version information for an assembly consists of the following four values:
//
Expand Down
14 changes: 0 additions & 14 deletions GPS.NET/Ghostware.GPS.NET.UnitTests/UnitTest1.cs

This file was deleted.

Loading

0 comments on commit e932991

Please sign in to comment.