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
10 changes: 10 additions & 0 deletions Fitbit.NetCore.Tests/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="4.1.1.0-4.1.1.1" newVersion="4.1.1.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>
124 changes: 124 additions & 0 deletions Fitbit.NetCore.Tests/Fitbit.NetCore.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\Fitbit\packages\NUnit3TestAdapter.3.8.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\Fitbit\packages\NUnit3TestAdapter.3.8.0\build\net35\NUnit3TestAdapter.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DE9D7F3C-6F6C-43E2-AEE6-32E7DF894F3E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Fitbit.NetCore.Tests</RootNamespace>
<AssemblyName>Fitbit.NetCore.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6</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>
<TargetFrameworkProfile />
</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="Castle.Core, Version=4.1.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\Castle.Core.4.1.1\lib\net45\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="FluentAssertions, Version=4.19.3.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\FluentAssertions.4.19.3\lib\net45\FluentAssertions.dll</HintPath>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.19.3.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\FluentAssertions.4.19.3\lib\net45\FluentAssertions.Core.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.7.99.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\Moq.4.7.99\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.7.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\NUnit.3.7.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Ploeh.AutoFixture, Version=3.50.0.0, Culture=neutral, PublicKeyToken=b24654c590009d4f, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\AutoFixture.3.50.3\lib\net40\Ploeh.AutoFixture.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\System.Net.Http.4.3.2\lib\net46\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net46\System.Security.Cryptography.Algorithms.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\Fitbit\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net46\System.Security.Cryptography.X509Certificates.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<!-- Add all the tests except the FitbitReponseTests which are not used -->
<Compile Include="..\Fitbit.Portable.Tests\**\*.cs" Exclude="..\Fitbit.Portable.Tests\**\FitbitResponseTests.cs">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
</Compile>

<!-- Add the sample data files-->
<None Include="..\Fitbit.Portable.Tests\**\*.xml">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

<None Include="..\Fitbit.Portable.Tests\**\*.json">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<!-- When testing, we want to use the .NET Standard 1.3 asset and not the 4.5 one -->
<PropertyGroup>
<ReferringTargetFrameworkForProjectReferences>netstandard1.3</ReferringTargetFrameworkForProjectReferences>
</PropertyGroup>

<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Fitbit.NetCore\Fitbit.NetCore.csproj">
<Project>{81f4f528-0e81-49e0-a2b2-ed77495a9c15}</Project>
<Name>Fitbit.NetCore</Name>
</ProjectReference>
</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('..\Fitbit\packages\NUnit3TestAdapter.3.8.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\Fitbit\packages\NUnit3TestAdapter.3.8.0\build\net35\NUnit3TestAdapter.props'))" />
</Target>
</Project>
22 changes: 22 additions & 0 deletions Fitbit.NetCore.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoFixture" version="3.50.3" targetFramework="net46" />
<package id="Castle.Core" version="4.1.1" targetFramework="net46" />
<package id="FluentAssertions" version="4.19.3" targetFramework="net46" />
<package id="Moq" version="4.7.99" targetFramework="net46" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net46" />
<package id="NUnit" version="3.7.1" targetFramework="net46" />
<package id="NUnit.Console" version="3.7.0" targetFramework="net46" />
<package id="NUnit.ConsoleRunner" version="3.7.0" targetFramework="net46" />
<package id="NUnit.Extension.NUnitProjectLoader" version="3.5.0" targetFramework="net46" />
<package id="NUnit.Extension.NUnitV2Driver" version="3.6.0" targetFramework="net46" />
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.5.0" targetFramework="net46" />
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net46" />
<package id="NUnit.Extension.VSProjectLoader" version="3.5.0" targetFramework="net46" />
<package id="NUnit3TestAdapter" version="3.8.0" targetFramework="net46" />
<package id="System.Net.Http" version="4.3.2" targetFramework="net46" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net46" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net46" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net46" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net46" />
</packages>
31 changes: 31 additions & 0 deletions Fitbit.NetCore/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;

// 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("Fitbit.NetCore")]
[assembly: AssemblyDescription("Fitbit API client for .NET")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Fitbit.Portable")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]

// 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("2.0.1.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

[assembly: InternalsVisibleTo("Fitbit.NetCore.Tests")]
40 changes: 40 additions & 0 deletions Fitbit.NetCore/Fitbit.NetCore.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.3;net45</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DefineConstants>DEBUG;NETSTANDARD1_3</DefineConstants>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
<AssemblyName>Fitbit</AssemblyName>
<RootNamespace>Fitbit</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>Fitbit.NET</PackageId>
<PackageVersion>3.0.0</PackageVersion>
<Authors>Fitbit.Net contributors Team -- @WestDiscGolf, @aarondcoleman, @mxa0079, @joshFitabase</Authors>
<PackageLicenseUrl>https://github.com/aarondcoleman/Fitbit.NET</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/aarondcoleman/Fitbit.NET</PackageProjectUrl>
<PackageIconUrl>http://static3.fitbit.com/simple.b-dis-png.h76d53d8e6a0653b38326a825b2b9cf57.pack?items=%2Fimages%2Fcommon%2Fbg_branding_b.png</PackageIconUrl>
<PackageTags>Fitbit OAuth2 API .NET IoT Wearables</PackageTags>
<PackageOutputPath>..\NuGet</PackageOutputPath>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Fitbit.Portable\**\*.cs" Exclude="..\Fitbit.Portable\**\AssemblyInfo.cs">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
</Compile>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netstandard1.3'">
<PackageReference Include="System.Xml.XmlDocument" Version="4.3.0" />
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net45'">
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
</ItemGroup>
</Project>
3 changes: 2 additions & 1 deletion Fitbit.Portable.Tests/ActivitiesStatsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
using Fitbit.Models;
using FluentAssertions;
using NUnit.Framework;
using System.Threading.Tasks;

namespace Fitbit.Portable.Tests
{
public class ActivitiesStatsTests
{
[Test]
[Category("Portable")]
public async void GetActivityStatsAsync_Success()
public async Task GetActivityStatsAsync_Success()
{
string content = SampleDataHelper.GetContent("ActivitiesStats.json");

Expand Down
29 changes: 15 additions & 14 deletions Fitbit.Portable.Tests/AddSubscriptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Fitbit.Api.Portable;
using Fitbit.Models;
using NUnit.Framework;
using System.Threading.Tasks;

namespace Fitbit.Portable.Tests
{
Expand All @@ -26,7 +27,7 @@ public class AddSubscriptionTests
[Test]
[Category("PubSub")]
[Category("Portable")]
public async void AddSubscription_UserEndPoint_WithoutSubscriberId()
public async Task AddSubscription_UserEndPoint_WithoutSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -42,7 +43,7 @@ public async void AddSubscription_UserEndPoint_WithoutSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_UserEndPoint_WithSubscriberId()
public async Task AddSubscription_UserEndPoint_WithSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -64,7 +65,7 @@ public async void AddSubscription_UserEndPoint_WithSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_ActivitiesEndPoint_WithoutSubscriberId()
public async Task AddSubscription_ActivitiesEndPoint_WithoutSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -80,7 +81,7 @@ public async void AddSubscription_ActivitiesEndPoint_WithoutSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_ActivitiesEndPoint_WithSubscriberId()
public async Task AddSubscription_ActivitiesEndPoint_WithSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -102,7 +103,7 @@ public async void AddSubscription_ActivitiesEndPoint_WithSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_BodyEndPoint_WithoutSubscriberId()
public async Task AddSubscription_BodyEndPoint_WithoutSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -118,7 +119,7 @@ public async void AddSubscription_BodyEndPoint_WithoutSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_BodyEndPoint_WithSubscriberId()
public async Task AddSubscription_BodyEndPoint_WithSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -140,7 +141,7 @@ public async void AddSubscription_BodyEndPoint_WithSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_FoodEndPoint_WithoutSubscriberId()
public async Task AddSubscription_FoodEndPoint_WithoutSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -156,7 +157,7 @@ public async void AddSubscription_FoodEndPoint_WithoutSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_FoodEndPoint_WithSubscriberId()
public async Task AddSubscription_FoodEndPoint_WithSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -178,7 +179,7 @@ public async void AddSubscription_FoodEndPoint_WithSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_MealsEndPoint_WithoutSubscriberId()
public async Task AddSubscription_MealsEndPoint_WithoutSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -194,7 +195,7 @@ public async void AddSubscription_MealsEndPoint_WithoutSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_MealsEndPoint_WithSubscriberId()
public async Task AddSubscription_MealsEndPoint_WithSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -216,7 +217,7 @@ public async void AddSubscription_MealsEndPoint_WithSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_SleepEndPoint_WithoutSubscriberId()
public async Task AddSubscription_SleepEndPoint_WithoutSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -232,7 +233,7 @@ public async void AddSubscription_SleepEndPoint_WithoutSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_SleepEndPoint_WithSubscriberId()
public async Task AddSubscription_SleepEndPoint_WithSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -254,7 +255,7 @@ public async void AddSubscription_SleepEndPoint_WithSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_WeightEndPoint_WithoutSubscriberId()
public async Task AddSubscription_WeightEndPoint_WithoutSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand All @@ -270,7 +271,7 @@ public async void AddSubscription_WeightEndPoint_WithoutSubscriberId()

[Category("PubSub")]
[Test] [Category("Portable")]
public async void AddSubscription_WeightEndPoint_WithSubscriberId()
public async Task AddSubscription_WeightEndPoint_WithSubscriberId()
{
Action<HttpRequestMessage> additionalChecks = message =>
{
Expand Down
2 changes: 1 addition & 1 deletion Fitbit.Portable.Tests/BloodPressureTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Fitbit.Portable.Tests
public class BloodPressureTests
{
[Test] [Category("Portable")]
public async void GetBloodPressureAsync_Success()
public async Task GetBloodPressureAsync_Success()
{
string content = SampleDataHelper.GetContent("GetBloodPressure.json");

Expand Down
Loading