Moved to a single-project csproj NET Standard solution
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/UnitTests/NmeaParser.Tests.UWP/Assets/StoreLogo.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
147
src/UnitTests/NmeaParser.Tests.UWP/NmeaParser.Tests.UWP.csproj
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" 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)' == '' ">x86</Platform>
|
||||
<ProjectGuid>{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}</ProjectGuid>
|
||||
<OutputType>AppContainerExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>NmeaParser.Tests</RootNamespace>
|
||||
<AssemblyName>NmeaParser.Tests</AssemblyName>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.14393.0</TargetPlatformMinVersion>
|
||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<PackageCertificateKeyFile>NmeaParser.Tests.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||
<UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">$(VisualStudioVersion)</UnitTestPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!--A reference to the entire .Net Framework and Windows SDK are automatically included-->
|
||||
<None Include="project.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<SDKReference Include="TestPlatform.Universal, Version=$(UnitTestPlatformVersion)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UnitTestApp.xaml.cs">
|
||||
<DependentUpon>UnitTestApp.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="UnitTestApp.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
<None Include="NmeaParser.Tests.UWP_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\..\NmeaSampleData.txt">
|
||||
<Link>NmeaSampleData.txt</Link>
|
||||
</Content>
|
||||
<Content Include="Properties\UnitTestApp.rd.xml" />
|
||||
<Content Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="Assets\StoreLogo.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\NmeaParser\NmeaParser.csproj">
|
||||
<Project>{1adc3666-1ddb-48c4-9811-1e58b6d09a7c}</Project>
|
||||
<Name>NmeaParser</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="..\NmeaParser.Tests\NmeaParser.Tests.projitems" Label="Shared" />
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">C:\GitHub\dotMorten\NmeaParser\src\UnitTests\NmeaParser.Tests.UWP\project.lock.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\mort5161\.nuget\packages\;C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">ProjectJson</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.5.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.2\build\Microsoft.Net.Native.Compiler.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.2\build\Microsoft.Net.Native.Compiler.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)mstest.testadapter\1.2.0\build\uap10.0\MSTest.TestAdapter.props" Condition="Exists('$(NuGetPackageRoot)mstest.testadapter\1.2.0\build\uap10.0\MSTest.TestAdapter.props')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.2\build\Microsoft.Net.Native.Compiler.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.2\build\Microsoft.Net.Native.Compiler.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)mstest.testadapter\1.2.0\build\uap10.0\MSTest.TestAdapter.targets" Condition="Exists('$(NuGetPackageRoot)mstest.testadapter\1.2.0\build\uap10.0\MSTest.TestAdapter.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
45
src/UnitTests/NmeaParser.Tests.UWP/Package.appxmanifest
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
IgnorableNamespaces="uap mp">
|
||||
|
||||
<Identity Name="e832a0b9-61f6-4611-9e12-8b9ca6dae591"
|
||||
Publisher="CN=mort5161"
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="e832a0b9-61f6-4611-9e12-8b9ca6dae591" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>NmeaParser.Tests.UWP</DisplayName>
|
||||
<PublisherDisplayName>mort5161</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application Id="vstest.executionengine.universal.App"
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="NmeaParser.Tests.UWP.App">
|
||||
<uap:VisualElements
|
||||
DisplayName="NmeaParser.Tests.UWP"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png"
|
||||
Description="NmeaParser.Tests.UWP"
|
||||
BackgroundColor="transparent">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>
|
||||
<Capability Name="internetClientServer" />
|
||||
</Capabilities>
|
||||
</Package>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("NmeaParser.Tests.UWP")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("NmeaParser.Tests.UWP")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: AssemblyMetadata("TargetPlatform","UAP")]
|
||||
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<!--
|
||||
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
|
||||
developers. However, you can modify these parameters to modify the behavior of the .NET Native
|
||||
optimizer.
|
||||
|
||||
Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919
|
||||
|
||||
To fully enable reflection for App1.MyClass and all of its public/private members
|
||||
<Type Name="App1.MyClass" Dynamic="Required All"/>
|
||||
|
||||
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
|
||||
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
|
||||
|
||||
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
|
||||
<Namespace Name="DataClasses.ViewModels" Seralize="All" />
|
||||
-->
|
||||
|
||||
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
|
||||
<Application>
|
||||
<!--
|
||||
An Assembly element with Name="*Application*" applies to all assemblies in
|
||||
the application package. The asterisks are not wildcards.
|
||||
-->
|
||||
<Assembly Name="*Application*" Dynamic="Required All" />
|
||||
<!-- Add your application specific runtime directives here. -->
|
||||
|
||||
|
||||
</Application>
|
||||
</Directives>
|
||||
8
src/UnitTests/NmeaParser.Tests.UWP/UnitTestApp.xaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<Application
|
||||
x:Class="NmeaParser.Tests.UWP.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:NmeaParser.Tests.UWP"
|
||||
RequestedTheme="Light">
|
||||
|
||||
</Application>
|
||||
102
src/UnitTests/NmeaParser.Tests.UWP/UnitTestApp.xaml.cs
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
namespace NmeaParser.Tests.UWP
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides application-specific behavior to supplement the default Application class.
|
||||
/// </summary>
|
||||
sealed partial class App : Application
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes the singleton application object. This is the first line of authored code
|
||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||
/// </summary>
|
||||
public App()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.Suspending += OnSuspending;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the application is launched normally by the end user. Other entry points
|
||||
/// will be used such as when the application is launched to open a specific file.
|
||||
/// </summary>
|
||||
/// <param name="e">Details about the launch request and process.</param>
|
||||
protected override void OnLaunched(LaunchActivatedEventArgs e)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
this.DebugSettings.EnableFrameRateCounter = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
Frame rootFrame = Window.Current.Content as Frame;
|
||||
|
||||
// Do not repeat app initialization when the Window already has content,
|
||||
// just ensure that the window is active
|
||||
if (rootFrame == null)
|
||||
{
|
||||
// Create a Frame to act as the navigation context and navigate to the first page
|
||||
rootFrame = new Frame();
|
||||
|
||||
rootFrame.NavigationFailed += OnNavigationFailed;
|
||||
|
||||
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
|
||||
{
|
||||
//TODO: Load state from previously suspended application
|
||||
}
|
||||
|
||||
// Place the frame in the current Window
|
||||
Window.Current.Content = rootFrame;
|
||||
}
|
||||
|
||||
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI();
|
||||
|
||||
// Ensure the current window is active
|
||||
Window.Current.Activate();
|
||||
|
||||
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(e.Arguments);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when Navigation to a certain page fails
|
||||
/// </summary>
|
||||
/// <param name="sender">The Frame which failed navigation</param>
|
||||
/// <param name="e">Details about the navigation failure</param>
|
||||
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
|
||||
{
|
||||
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when application execution is being suspended. Application state is saved
|
||||
/// without knowing whether the application will be terminated or resumed with the contents
|
||||
/// of memory still intact.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the suspend request.</param>
|
||||
/// <param name="e">Details about the suspend request.</param>
|
||||
private void OnSuspending(object sender, SuspendingEventArgs e)
|
||||
{
|
||||
var deferral = e.SuspendingOperation.GetDeferral();
|
||||
//TODO: Save application state and stop any background activity
|
||||
deferral.Complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
18
src/UnitTests/NmeaParser.Tests.UWP/project.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.UniversalWindowsPlatform": "6.0.4",
|
||||
"MSTest.TestAdapter": "1.2.0",
|
||||
"MSTest.TestFramework": "1.2.0"
|
||||
},
|
||||
"frameworks": {
|
||||
"uap10.0.10586": {}
|
||||
},
|
||||
"runtimes": {
|
||||
"win10-arm": {},
|
||||
"win10-arm-aot": {},
|
||||
"win10-x86": {},
|
||||
"win10-x86-aot": {},
|
||||
"win10-x64": {},
|
||||
"win10-x64-aot": {}
|
||||
}
|
||||
}
|
||||
21
src/UnitTests/NmeaParser.Tests/BufferedStringDevice.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NmeaParser.Tests
|
||||
{
|
||||
internal class BufferedStringDevice : NmeaParser.BufferedStreamDevice
|
||||
{
|
||||
string m_data;
|
||||
public BufferedStringDevice(string data) : base(1)
|
||||
{
|
||||
m_data = data;
|
||||
}
|
||||
protected override Task<System.IO.Stream> GetStreamAsync()
|
||||
{
|
||||
return Task.FromResult<System.IO.Stream>(new System.IO.MemoryStream(UTF8Encoding.UTF8.GetBytes(m_data)));
|
||||
}
|
||||
}
|
||||
}
|
||||
80
src/UnitTests/NmeaParser.Tests/DeviceTests.cs
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NmeaParser.Tests
|
||||
{
|
||||
[TestClass]
|
||||
public class DeviceTests
|
||||
{
|
||||
[TestMethod]
|
||||
[TestCategory("Device")]
|
||||
public async Task TestGpgsvGroupMessage()
|
||||
{
|
||||
var message = "$GPGSV,3,1,9,00,30,055,48,00,19,281,00,27,19,275,00,12,16,319,00*4C\n$GPGSV,3,2,9,00,30,055,48,00,19,281,00,27,19,275,00,12,16,319,00*4F\n$GPGSV,3,3,9,32,10,037,00,,,,,,,,,,,,*74";
|
||||
NmeaDevice dev = new BufferedStringDevice(message);
|
||||
TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
|
||||
int count = 0;
|
||||
dev.MessageReceived += (s, e) =>
|
||||
{
|
||||
count++;
|
||||
try
|
||||
{
|
||||
Assert.IsTrue(e.IsMultipart, "IsMultiPart");
|
||||
Assert.IsInstanceOfType(e.Message, typeof(NmeaParser.Nmea.Gps.Gpgsv));
|
||||
var msg = e.Message as NmeaParser.Nmea.Gps.Gpgsv;
|
||||
if (msg.TotalMessages == msg.MessageNumber)
|
||||
{
|
||||
Assert.IsNotNull(e.MessageParts);
|
||||
Assert.AreEqual(e.MessageParts.Count, 3, "MessageParts.Length");
|
||||
tcs.SetResult(true);
|
||||
}
|
||||
else
|
||||
Assert.IsNull(e.MessageParts);
|
||||
if (count > 3)
|
||||
Assert.Fail();
|
||||
}
|
||||
catch(System.Exception ex)
|
||||
{
|
||||
tcs.SetException(ex);
|
||||
}
|
||||
};
|
||||
await dev.OpenAsync();
|
||||
await tcs.Task;
|
||||
var _ = dev.CloseAsync();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[TestCategory("Device")]
|
||||
public async Task TestInvalidGpgsvGroupMessage()
|
||||
{
|
||||
var message = "$GPGSV,3,2,9,00,30,055,48,00,19,281,00,27,19,275,00,12,16,319,00*4D\n$GPGSV,3,2,9,00,30,055,48,00,19,281,00,27,19,275,00,12,16,319,00*4F\n$GPGSV,3,3,9,32,10,037,00,,,,,,,,,,,,*74";
|
||||
NmeaDevice dev = new BufferedStringDevice(message);
|
||||
TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
|
||||
int count = 0;
|
||||
dev.MessageReceived += (s, e) =>
|
||||
{
|
||||
count++;
|
||||
try
|
||||
{
|
||||
Assert.IsTrue(e.IsMultipart, "IsMultiPart");
|
||||
Assert.IsInstanceOfType(e.Message, typeof(NmeaParser.Nmea.Gps.Gpgsv));
|
||||
var msg = e.Message as NmeaParser.Nmea.Gps.Gpgsv;
|
||||
Assert.IsNull(e.MessageParts);
|
||||
if (count > 6)
|
||||
tcs.SetResult(true);
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
tcs.SetException(ex);
|
||||
}
|
||||
};
|
||||
await dev.OpenAsync();
|
||||
await tcs.Task;
|
||||
var _ = dev.CloseAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
397
src/UnitTests/NmeaParser.Tests/NmeaMessages.cs
Normal file
|
|
@ -0,0 +1,397 @@
|
|||
//
|
||||
// Copyright (c) 2014 Morten Nielsen
|
||||
//
|
||||
// Licensed under the Microsoft Public License (Ms-PL) (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://opensource.org/licenses/Ms-PL.html
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using NmeaParser.Nmea;
|
||||
using NmeaParser.Nmea.Gps;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using NmeaParser.Nmea.Gnss;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace NmeaParser.Tests
|
||||
{
|
||||
[TestClass]
|
||||
public class NmeaMessages
|
||||
{
|
||||
[TestMethod]
|
||||
public async Task ParseNmeaFile()
|
||||
{
|
||||
var file = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///NmeaSampleData.txt"));
|
||||
System.IO.StreamReader reader = new System.IO.StreamReader(await file.OpenStreamForReadAsync());
|
||||
while(!reader.EndOfStream)
|
||||
{
|
||||
var line = reader.ReadLine();
|
||||
if (line.StartsWith("$"))
|
||||
{
|
||||
var msg = NmeaMessage.Parse(line);
|
||||
Assert.IsNotNull(msg);
|
||||
var idx = line.IndexOf('*');
|
||||
if (idx >= 0)
|
||||
{
|
||||
byte checksum = (byte)Convert.ToInt32(line.Substring(idx + 1), 16);
|
||||
Assert.AreEqual(checksum, msg.Checksum);
|
||||
}
|
||||
Assert.IsNotInstanceOfType(msg, typeof(Nmea.UnknownMessage), "Type " + msg.MessageType + " not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGprmb_Empty()
|
||||
{
|
||||
string input = "$GPRMB,A,,,,,,,,,,,,A,A*0B";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gprmb));
|
||||
Gprmb rmb = (Gprmb)msg;
|
||||
Assert.AreEqual(true, rmb.Arrived);
|
||||
Assert.AreEqual(double.NaN, rmb.CrossTrackError);
|
||||
Assert.AreEqual(double.NaN, rmb.DestinationLatitude);
|
||||
Assert.AreEqual(double.NaN, rmb.DestinationLongitude);
|
||||
Assert.AreEqual(0, rmb.DestinationWaypointId);
|
||||
Assert.AreEqual(0, rmb.OriginWaypointId);
|
||||
Assert.AreEqual(double.NaN, rmb.RangeToDestination);
|
||||
Assert.AreEqual(Gprmb.DataStatus.Ok, rmb.Status);
|
||||
Assert.AreEqual(double.NaN, rmb.TrueBearing);
|
||||
Assert.AreEqual(double.NaN, rmb.Velocity);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGprmb()
|
||||
{
|
||||
string input = "$GPRMB,A,0.66,L,003,004,4917.24,S,12309.57,W,001.3,052.5,000.5,V*3D";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gprmb));
|
||||
Gprmb rmb = (Gprmb)msg;
|
||||
Assert.AreEqual(Gprmb.DataStatus.Ok, rmb.Status);
|
||||
Assert.AreEqual(-.66, rmb.CrossTrackError);
|
||||
Assert.AreEqual(3, rmb.OriginWaypointId);
|
||||
Assert.AreEqual(4, rmb.DestinationWaypointId);
|
||||
Assert.AreEqual(-49.287333333333333333, rmb.DestinationLatitude);
|
||||
Assert.AreEqual(-123.1595, rmb.DestinationLongitude);
|
||||
Assert.AreEqual(1.3, rmb.RangeToDestination);
|
||||
Assert.AreEqual(52.5, rmb.TrueBearing);
|
||||
Assert.AreEqual(.5, rmb.Velocity);
|
||||
Assert.AreEqual(false, rmb.Arrived);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGprmc()
|
||||
{
|
||||
string input = "$GPRMC,123519,A,4807.038,S,01131.000,W,022.4,084.4,230313,003.1,W*6A";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gprmc));
|
||||
Gprmc rmc = (Gprmc)msg;
|
||||
Assert.AreEqual(new DateTime(2013, 03, 23, 12, 35, 19, DateTimeKind.Utc), rmc.FixTime);
|
||||
Assert.AreEqual(-48.1173, rmc.Latitude);
|
||||
Assert.AreEqual(-11.516666666666667, rmc.Longitude, 0.0000000001);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpgga()
|
||||
{
|
||||
string input = "$GPGGA,235236,3925.9479,N,11945.9211,W,1,10,0.8,1378.0,M,-22.1,M,,*46";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpgga));
|
||||
Gpgga gga = (Gpgga)msg;
|
||||
Assert.AreEqual(new TimeSpan(23, 52, 36), gga.FixTime);
|
||||
Assert.AreEqual(39.432465, gga.Latitude);
|
||||
Assert.AreEqual(-119.7653516666666667, gga.Longitude, 0.0000000001);
|
||||
Assert.AreEqual(NmeaParser.Nmea.Gps.Gpgga.FixQuality.GpsFix, gga.Quality);
|
||||
Assert.AreEqual(10, gga.NumberOfSatellites);
|
||||
Assert.AreEqual(.8, gga.Hdop);
|
||||
Assert.AreEqual(1378, gga.Altitude);
|
||||
Assert.AreEqual("M", gga.AltitudeUnits);
|
||||
Assert.AreEqual(-22.1, gga.HeightOfGeoid);
|
||||
Assert.AreEqual("M", gga.HeightOfGeoidUnits);
|
||||
Assert.AreEqual(-1, gga.DgpsStationId);
|
||||
Assert.AreEqual(TimeSpan.MaxValue, gga.TimeSinceLastDgpsUpdate);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestPtlna()
|
||||
{
|
||||
string input = "$PTNLA,HV,002.94,M,288.1,D,008.6,D,002.98,M*74";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(NmeaParser.Nmea.LaserRange.Trimble.Ptnla));
|
||||
NmeaParser.Nmea.LaserRange.Trimble.Ptnla ptlna = (NmeaParser.Nmea.LaserRange.Trimble.Ptnla)msg;
|
||||
Assert.AreEqual(2.94, ptlna.HorizontalDistance);
|
||||
Assert.AreEqual('M', ptlna.HorizontalDistanceUnits);
|
||||
Assert.AreEqual(288.1, ptlna.HorizontalAngle);
|
||||
Assert.AreEqual('D', ptlna.HorizontalAngleUnits);
|
||||
Assert.AreEqual(8.6, ptlna.VerticalAngle);
|
||||
Assert.AreEqual('D', ptlna.VerticalAngleUnits);
|
||||
Assert.AreEqual(2.98, ptlna.SlopeDistance);
|
||||
Assert.AreEqual('M', ptlna.SlopeDistanceUnits);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestPgrme()
|
||||
{
|
||||
string input = "$PGRME,2.3,M,3.3,M,4.0,M*2B";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(NmeaParser.Nmea.Gps.Garmin.Pgrme));
|
||||
NmeaParser.Nmea.Gps.Garmin.Pgrme rme = (NmeaParser.Nmea.Gps.Garmin.Pgrme)msg;
|
||||
Assert.AreEqual(2.3, rme.HorizontalError);
|
||||
Assert.AreEqual("M", rme.HorizontalErrorUnits);
|
||||
Assert.AreEqual(3.3, rme.VerticalError);
|
||||
Assert.AreEqual("M", rme.VerticalErrorUnits);
|
||||
Assert.AreEqual(4.0, rme.SphericalError);
|
||||
Assert.AreEqual("M", rme.SphericalErrorUnits);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpgsa_Empty()
|
||||
{
|
||||
string input = "$GPGSA,A,3,,,,,,16,18,,22,24,,,,,*14";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpgsa));
|
||||
Gpgsa gsa = (Gpgsa)msg;
|
||||
Assert.AreEqual(Gpgsa.ModeSelection.Auto, gsa.GpsMode);
|
||||
Assert.AreEqual(Gpgsa.Mode.Fix3D, gsa.FixMode);
|
||||
Assert.AreEqual(4, gsa.SVs.Count);
|
||||
Assert.AreEqual(16, gsa.SVs[0]);
|
||||
Assert.AreEqual(18, gsa.SVs[1]);
|
||||
Assert.AreEqual(22, gsa.SVs[2]);
|
||||
Assert.AreEqual(24, gsa.SVs[3]);
|
||||
Assert.AreEqual(double.NaN, gsa.Pdop);
|
||||
Assert.AreEqual(double.NaN, gsa.Hdop);
|
||||
Assert.AreEqual(double.NaN, gsa.Vdop);
|
||||
}
|
||||
[TestMethod]
|
||||
public void TestGpgsa()
|
||||
{
|
||||
string input = "$GPGSA,M,2,19,28,14,18,27,22,31,39,40,42,43,44,1.7,1.0,1.3*3C";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpgsa));
|
||||
Gpgsa gsa = (Gpgsa)msg;
|
||||
Assert.AreEqual(Gpgsa.ModeSelection.Manual, gsa.GpsMode);
|
||||
Assert.AreEqual(Gpgsa.Mode.Fix2D, gsa.FixMode);
|
||||
Assert.AreEqual(12, gsa.SVs.Count);
|
||||
Assert.AreEqual(19, gsa.SVs[0]);
|
||||
Assert.AreEqual(28, gsa.SVs[1]);
|
||||
Assert.AreEqual(14, gsa.SVs[2]);
|
||||
Assert.AreEqual(18, gsa.SVs[3]);
|
||||
Assert.AreEqual(27, gsa.SVs[4]);
|
||||
Assert.AreEqual(22, gsa.SVs[5]);
|
||||
Assert.AreEqual(31, gsa.SVs[6]);
|
||||
Assert.AreEqual(39, gsa.SVs[7]);
|
||||
Assert.AreEqual(40, gsa.SVs[8]);
|
||||
Assert.AreEqual(42, gsa.SVs[9]);
|
||||
Assert.AreEqual(43, gsa.SVs[10]);
|
||||
Assert.AreEqual(44, gsa.SVs[11]);
|
||||
Assert.AreEqual(1.7, gsa.Pdop);
|
||||
Assert.AreEqual(1.0, gsa.Hdop);
|
||||
Assert.AreEqual(1.3, gsa.Vdop);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpgsv()
|
||||
{
|
||||
string input = "$GPGSV,3,3,11,22,42,067,42,75,14,311,43,50,05,244,00,,,,*49";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpgsv));
|
||||
Gpgsv gsv = (Gpgsv)msg;
|
||||
Assert.AreEqual(3, gsv.TotalMessages);
|
||||
Assert.AreEqual(3, gsv.MessageNumber);
|
||||
Assert.AreEqual(11, gsv.SVsInView);
|
||||
Assert.IsNotNull(gsv.SVs);
|
||||
Assert.AreEqual(3, gsv.SVs.Count);
|
||||
var sv = gsv.SVs[0];
|
||||
Assert.AreEqual(22, sv.PrnNumber);
|
||||
Assert.AreEqual(42, sv.Elevation);
|
||||
Assert.AreEqual(67, sv.Azimuth);
|
||||
Assert.AreEqual(42, sv.SignalToNoiseRatio);
|
||||
Assert.AreEqual(SatelliteSystem.Gps, sv.System);
|
||||
|
||||
sv = gsv.SVs[1];
|
||||
Assert.AreEqual(75, sv.PrnNumber);
|
||||
Assert.AreEqual(14, sv.Elevation);
|
||||
Assert.AreEqual(311, sv.Azimuth);
|
||||
Assert.AreEqual(43, sv.SignalToNoiseRatio);
|
||||
Assert.AreEqual(SatelliteSystem.Glonass, sv.System);
|
||||
|
||||
sv = gsv.SVs[2];
|
||||
Assert.AreEqual(50, sv.PrnNumber);
|
||||
Assert.AreEqual(5, sv.Elevation);
|
||||
Assert.AreEqual(244, sv.Azimuth);
|
||||
Assert.AreEqual(00, sv.SignalToNoiseRatio);
|
||||
Assert.AreEqual(SatelliteSystem.Waas, sv.System);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpgsv_Empty()
|
||||
{
|
||||
string input = "$GPGSV,1,1,0,,,,,,,,,,,,,,,,*49";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpgsv));
|
||||
Gpgsv gsv = (Gpgsv)msg;
|
||||
Assert.AreEqual(1, gsv.TotalMessages);
|
||||
Assert.AreEqual(1, gsv.MessageNumber);
|
||||
Assert.AreEqual(0, gsv.SVsInView);
|
||||
Assert.IsNotNull(gsv.SVs);
|
||||
Assert.AreEqual(0, gsv.SVs.Count);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpgll()
|
||||
{
|
||||
string input = "$GPGLL,4916.45,N,12311.12,W,225444.12,A,*30";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpgll));
|
||||
Gpgll gll = (Gpgll)msg;
|
||||
Assert.IsTrue(gll.DataActive);
|
||||
Assert.AreEqual(49.2741666666666666667, gll.Latitude);
|
||||
Assert.AreEqual(-123.18533333333333333, gll.Longitude);
|
||||
Assert.AreEqual(new TimeSpan(0,22,54,44,120), gll.FixTime);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpgll_NoFixTime_OrActiveIndicator()
|
||||
{
|
||||
string input = "$GPGLL,3751.65,S,14507.36,E*77";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpgll));
|
||||
Gpgll gll = (Gpgll)msg;
|
||||
Assert.IsTrue(gll.DataActive);
|
||||
Assert.AreEqual(-37.860833333333333333, gll.Latitude);
|
||||
Assert.AreEqual(145.1226666666666666667, gll.Longitude);
|
||||
Assert.AreEqual(TimeSpan.Zero, gll.FixTime);
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpbod_Empty()
|
||||
{
|
||||
string input = "$GPBOD,,T,,M,,*47";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpbod));
|
||||
Gpbod bod = (Gpbod)msg;
|
||||
Assert.AreEqual(double.NaN, bod.TrueBearing, "TrueBearing");
|
||||
Assert.AreEqual(double.NaN, bod.MagneticBearing, "MagneticBearing");
|
||||
Assert.IsNull(bod.OriginId, "OriginID");
|
||||
Assert.IsNull(bod.DestinationId, "DestinationID");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpbod_GoToMode()
|
||||
{
|
||||
string input = "$GPBOD,099.3,T,105.6,M,POINTB,*48";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpbod));
|
||||
Gpbod bod = (Gpbod)msg;
|
||||
Assert.AreEqual(99.3, bod.TrueBearing, "TrueBearing");
|
||||
Assert.AreEqual(105.6, bod.MagneticBearing, "MagneticBearing");
|
||||
Assert.AreEqual("POINTB", bod.DestinationId, "DestinationID");
|
||||
Assert.IsNull(bod.OriginId, "OriginID");
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpbod()
|
||||
{
|
||||
string input = "$GPBOD,097.0,T,103.2,M,POINTB,POINTA*4A";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpbod));
|
||||
Gpbod bod = (Gpbod)msg;
|
||||
Assert.AreEqual(97d, bod.TrueBearing, "TrueBearing");
|
||||
Assert.AreEqual(103.2, bod.MagneticBearing, "MagneticBearing");
|
||||
Assert.AreEqual("POINTB", bod.DestinationId, "DestinationID");
|
||||
Assert.AreEqual("POINTA", bod.OriginId, "OriginID");
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void TestPgrmz_Empty()
|
||||
{
|
||||
string input = "$PGRMZ,,,*7E";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(NmeaParser.Nmea.Gps.Garmin.Pgrmz));
|
||||
var rmz = (NmeaParser.Nmea.Gps.Garmin.Pgrmz)msg;
|
||||
Assert.AreEqual(double.NaN, rmz.Altitude, "Altitude");
|
||||
Assert.AreEqual(NmeaParser.Nmea.Gps.Garmin.Pgrmz.AltitudeUnit.Unknown, rmz.Unit, "Unit");
|
||||
Assert.AreEqual(NmeaParser.Nmea.Gps.Garmin.Pgrmz.PositionFixType.Unknown, rmz.FixType, "FixDimension");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestPgrmz()
|
||||
{
|
||||
string input = "$PGRMZ,93,f,3*21";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(NmeaParser.Nmea.Gps.Garmin.Pgrmz));
|
||||
var rmz = (NmeaParser.Nmea.Gps.Garmin.Pgrmz)msg;
|
||||
Assert.AreEqual(93d, rmz.Altitude, "Altitude");
|
||||
Assert.AreEqual(NmeaParser.Nmea.Gps.Garmin.Pgrmz.AltitudeUnit.Feet, rmz.Unit, "Unit");
|
||||
Assert.AreEqual(NmeaParser.Nmea.Gps.Garmin.Pgrmz.PositionFixType.Fix3D, rmz.FixType, "FixDimension");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGprte()
|
||||
{
|
||||
string input = "$GPRTE,2,1,c,0,W3IWI,DRIVWY,32CEDR,32-29,32BKLD,32-I95,32-US1,BW-32,BW-198*69";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gprte));
|
||||
Gprte gsv = (Gprte)msg;
|
||||
Assert.AreEqual(2, gsv.TotalMessages);
|
||||
Assert.AreEqual(1, gsv.MessageNumber);
|
||||
Assert.AreEqual(NmeaParser.Nmea.Gps.Gprte.WaypointListType.CompleteWaypointsList, gsv.ListType);
|
||||
Assert.AreEqual("0", gsv.RouteId);
|
||||
Assert.AreEqual("0", gsv.RouteId);
|
||||
Assert.AreEqual(9, gsv.Waypoints.Count);
|
||||
Assert.AreEqual("W3IWI", gsv.Waypoints[0]);
|
||||
Assert.AreEqual("32BKLD", gsv.Waypoints[4]);
|
||||
Assert.AreEqual("BW-198", gsv.Waypoints[8]);
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpgst()
|
||||
{
|
||||
string input = "$GPGST,172814.0,0.006,0.023,0.020,273.6,0.023,0.020,0.031*6A";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpgst));
|
||||
Gpgst gst = (Gpgst)msg;
|
||||
Assert.AreEqual(new TimeSpan(17, 28, 14), gst.FixTime);
|
||||
Assert.AreEqual(0.006, gst.Rms);
|
||||
Assert.AreEqual(0.023, gst.SemiMajorError);
|
||||
Assert.AreEqual(0.02, gst.SemiMinorError);
|
||||
Assert.AreEqual(273.6, gst.ErrorOrientation);
|
||||
Assert.AreEqual(0.023, gst.SigmaLatitudeError);
|
||||
Assert.AreEqual(0.020, gst.SigmaLongitudeError);
|
||||
Assert.AreEqual(0.031, gst.SigmaHeightError);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGngst()
|
||||
{
|
||||
string input = "$GNGST,172814.0,0.006,0.023,0.020,273.6,0.023,0.020,0.031*74";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gngst));
|
||||
Gngst gst = (Gngst)msg;
|
||||
Assert.AreEqual(new TimeSpan(17, 28, 14), gst.FixTime);
|
||||
Assert.AreEqual(0.006, gst.Rms);
|
||||
Assert.AreEqual(0.023, gst.SemiMajorError);
|
||||
Assert.AreEqual(0.02, gst.SemiMinorError);
|
||||
Assert.AreEqual(273.6, gst.ErrorOrientation);
|
||||
Assert.AreEqual(0.023, gst.SigmaLatitudeError);
|
||||
Assert.AreEqual(0.020, gst.SigmaLongitudeError);
|
||||
Assert.AreEqual(0.031, gst.SigmaHeightError);
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/UnitTests/NmeaParser.Tests/NmeaParser.Tests.projitems
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
<HasSharedItems>true</HasSharedItems>
|
||||
<SharedGUID>979ae182-eb59-4181-9d45-3fd6e4817f11</SharedGUID>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<Import_RootNamespace>NmeaParser.Tests</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)BufferedStringDevice.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)DeviceTests.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)NmeaMessages.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
13
src/UnitTests/NmeaParser.Tests/NmeaParser.Tests.shproj
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>979ae182-eb59-4181-9d45-3fd6e4817f11</ProjectGuid>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
|
||||
<PropertyGroup />
|
||||
<Import Project="NmeaParser.Tests.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
|
||||
</Project>
|
||||