Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to dotnetstandard2.0 #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.10.0"

var target = Argument("target", "Default");
var version = "1.1.0";
var version = "1.2.0";

Task("Build")
.Does(() =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
<Import Project="..\packages\NUnit.3.13.2\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.2\build\NUnit.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -38,23 +38,21 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="HelperSharp, Version=1.0.5358.23405, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\HelperSharp.0.0.4.1\lib\net35\HelperSharp.dll</HintPath>
<Reference Include="HelperSharp, Version=1.0.5560.27038, Culture=neutral, PublicKeyToken=3d44152485e1a4e1, processorArchitecture=MSIL">
<HintPath>..\packages\HelperSharp.0.0.4.2\lib\net35\HelperSharp.dll</HintPath>
</Reference>
<Reference Include="Ionic.Utils.Zip">
<HintPath>..\packages\TestSharp.1.0.2\lib\net40\Ionic.Utils.Zip.dll</HintPath>
<Reference Include="Ionic.Utils.Zip, Version=1.4.0.1, Culture=neutral, PublicKeyToken=c551e179877da246, processorArchitecture=MSIL">
<HintPath>..\packages\TestSharp.1.0.3\lib\net40\Ionic.Utils.Zip.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.12.0\lib\net40\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.13.2.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.13.2\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="TestSharp">
<HintPath>..\packages\TestSharp.1.0.2\lib\net40\TestSharp.dll</HintPath>
<Reference Include="TestSharp, Version=0.0.6.0, Culture=neutral, PublicKeyToken=76c905e92dbc6707, processorArchitecture=MSIL">
<HintPath>..\packages\TestSharp.1.0.3\lib\net40\TestSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand All @@ -74,7 +72,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SalesforceSharp\SalesforceSharp.csproj">
<Project>{0EA33E69-D046-42AF-9BF3-4B0F49EEA1D6}</Project>
<Project>{25138b0a-8016-4777-a189-a951a0602790}</Project>
<Name>SalesforceSharp</Name>
</ProjectReference>
</ItemGroup>
Expand All @@ -84,6 +82,6 @@
<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\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\NUnit.3.13.2\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.2\build\NUnit.props'))" />
</Target>
</Project>
8 changes: 4 additions & 4 deletions src/SalesforceSharp.FunctionalTests/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="HelperSharp" version="0.0.4.1" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" requireReinstallation="true" />
<package id="NUnit" version="3.12.0" targetFramework="net40" requireReinstallation="true" />
<package id="TestSharp" version="1.0.2" targetFramework="net40" />
<package id="HelperSharp" version="0.0.4.2" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
<package id="NUnit" version="3.13.2" targetFramework="net472" />
<package id="TestSharp" version="1.0.3" targetFramework="net472" />
</packages>
24 changes: 12 additions & 12 deletions src/SalesforceSharp.UnitTests/SalesforceSharp.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
<Import Project="..\packages\NUnit.3.13.2\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.2\build\NUnit.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -43,22 +43,22 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Ionic.Utils.Zip">
<HintPath>..\packages\TestSharp.1.0.2\lib\net40\Ionic.Utils.Zip.dll</HintPath>
<Reference Include="Ionic.Utils.Zip, Version=1.4.0.1, Culture=neutral, PublicKeyToken=c551e179877da246, processorArchitecture=MSIL">
<HintPath>..\packages\TestSharp.1.0.3\lib\net40\Ionic.Utils.Zip.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.12.0\lib\net40\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.13.2.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.13.2\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="RestSharp, Version=105.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\RestSharp.105.0.1\lib\net4\RestSharp.dll</HintPath>
<Reference Include="RestSharp, Version=106.12.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.106.12.0\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks">
<HintPath>..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="TestSharp">
<HintPath>..\packages\TestSharp.1.0.2\lib\net40\TestSharp.dll</HintPath>
<Reference Include="System.Web" />
<Reference Include="TestSharp, Version=0.0.6.0, Culture=neutral, PublicKeyToken=76c905e92dbc6707, processorArchitecture=MSIL">
<HintPath>..\packages\TestSharp.1.0.3\lib\net40\TestSharp.dll</HintPath>
</Reference>
</ItemGroup>
<Choose>
Expand Down Expand Up @@ -111,14 +111,14 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SalesforceSharp\SalesforceSharp.csproj">
<Project>{0EA33E69-D046-42AF-9BF3-4B0F49EEA1D6}</Project>
<Project>{25138b0a-8016-4777-a189-a951a0602790}</Project>
<Name>SalesforceSharp</Name>
</ProjectReference>
</ItemGroup>
<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\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\NUnit.3.13.2\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.2\build\NUnit.props'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void Authenticate_Success_AuthenticationInfo()
var restClient = MockRepository.GenerateMock<IRestClient>();
restClient.Expect(r => r.BaseUrl).SetPropertyWithArgument(new Uri("https://login.salesforce.com/services/oauth2/token"));
restClient.Expect(r => r.Execute(null)).IgnoreArguments().Return(response);

var target = new UsernamePasswordAuthenticationFlow(restClient, "clientId", "clientSecret", "userName", "password");
var actual = target.Authenticate();
Assert.AreEqual("access token 1", actual.AccessToken);
Expand Down
20 changes: 10 additions & 10 deletions src/SalesforceSharp.UnitTests/packages.config
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.12.0" targetFramework="net40" requireReinstallation="true" />
<package id="NUnit.Console" version="3.10.0" targetFramework="net472" />
<package id="NUnit.ConsoleRunner" version="3.10.0" targetFramework="net472" />
<package id="NUnit.Extension.NUnitProjectLoader" version="3.6.0" targetFramework="net472" />
<package id="NUnit.Extension.NUnitV2Driver" version="3.7.0" targetFramework="net472" />
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net472" />
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.6" targetFramework="net472" />
<package id="NUnit.Extension.VSProjectLoader" version="3.8.0" targetFramework="net472" />
<package id="RestSharp" version="105.0.1" targetFramework="net40" />
<package id="NUnit" version="3.13.2" targetFramework="net472" />
<package id="NUnit.Console" version="3.12.0" targetFramework="net472" />
<package id="NUnit.ConsoleRunner" version="3.12.0" targetFramework="net472" />
<package id="NUnit.Extension.NUnitProjectLoader" version="3.7.1" targetFramework="net472" />
<package id="NUnit.Extension.NUnitV2Driver" version="3.9.0" targetFramework="net472" />
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.7.0" targetFramework="net472" />
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.7" targetFramework="net472" />
<package id="NUnit.Extension.VSProjectLoader" version="3.9.0" targetFramework="net472" />
<package id="RestSharp" version="106.12.0" targetFramework="net472" />
<package id="RhinoMocks" version="3.6.1" targetFramework="net40" />
<package id="TestSharp" version="1.0.2" targetFramework="net40" />
<package id="TestSharp" version="1.0.3" targetFramework="net472" />
</packages>
12 changes: 6 additions & 6 deletions src/SalesforceSharp.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
<releaseNotes>Updated with latest pull-requests: https://github.com/giacomelli/SalesforceSharp/issues?page=1&amp;state=closed</releaseNotes>
<tags>salesforce rest clientlibrary</tags>
<dependencies>
<dependency id="HelperSharp" version="0.0.4.1" />
<dependency id="Newtonsoft.Json" version="6.0.6" />
<dependency id="RestSharp" version="105.0.1" />
<group targetFramework=".NETStandard2.0">
<dependency id="Microsoft.CSharp" version="4.7.0" />
<dependency id="Newtonsoft.Json" version="13.0.1" />
<dependency id="RestSharp" version="106.12.0" />
</group>
</dependencies>
</metadata>
<files>
<file src="SalesforceSharp.dll" target="lib/net45/SalesforceSharp.dll" />
<file src="SalesforceSharp.pdb" target="lib/net45/SalesforceSharp.pdb" />
<file src="SalesforceSharp.XML" target="lib/net45/SalesforceSharp.xml" />
<file src="SalesforceSharp.dll" target="lib/netstandard2.0/SalesforceSharp.dll" />
</files>
</package>
16 changes: 8 additions & 8 deletions src/SalesforceSharp.sln
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.271
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SalesforceSharp", "SalesforceSharp\SalesforceSharp.csproj", "{0EA33E69-D046-42AF-9BF3-4B0F49EEA1D6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SalesforceSharp.UnitTests", "SalesforceSharp.UnitTests\SalesforceSharp.UnitTests.csproj", "{2EFC38B5-5011-4F95-B29A-3809D4E70D7D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SalesforceSharp.FunctionalTests", "SalesforceSharp.FunctionalTests\SalesforceSharp.FunctionalTests.csproj", "{276ECE17-1F85-430F-AF1A-68D50B8B9A27}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SalesforceSharp", "SalesforceSharp\SalesforceSharp.csproj", "{25138B0A-8016-4777-A189-A951A0602790}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0EA33E69-D046-42AF-9BF3-4B0F49EEA1D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0EA33E69-D046-42AF-9BF3-4B0F49EEA1D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EA33E69-D046-42AF-9BF3-4B0F49EEA1D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EA33E69-D046-42AF-9BF3-4B0F49EEA1D6}.Release|Any CPU.Build.0 = Release|Any CPU
{2EFC38B5-5011-4F95-B29A-3809D4E70D7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2EFC38B5-5011-4F95-B29A-3809D4E70D7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EFC38B5-5011-4F95-B29A-3809D4E70D7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -27,6 +23,10 @@ Global
{276ECE17-1F85-430F-AF1A-68D50B8B9A27}.Debug|Any CPU.Build.0 = Debug|Any CPU
{276ECE17-1F85-430F-AF1A-68D50B8B9A27}.Release|Any CPU.ActiveCfg = Release|Any CPU
{276ECE17-1F85-430F-AF1A-68D50B8B9A27}.Release|Any CPU.Build.0 = Release|Any CPU
{25138B0A-8016-4777-A189-A951A0602790}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25138B0A-8016-4777-A189-A951A0602790}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25138B0A-8016-4777-A189-A951A0602790}.Release|Any CPU.ActiveCfg = Release|Any CPU
{25138B0A-8016-4777-A189-A951A0602790}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
50 changes: 50 additions & 0 deletions src/SalesforceSharp/ExceptionHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using System.Globalization;

namespace SalesforceSharp.Extensions
{
/// <summary>
/// Exception helper.
/// </summary>
public static class ExceptionHelper
{
/// <summary>
/// Throws an ArgumentNullException if argument is null.
/// </summary>
/// <param name="argumentName">The argument name.</param>
/// <param name="argument">The argument.</param>
public static void ThrowIfNull(string argumentName, object argument)
{
if (argument == null)
{
throw new ArgumentNullException(argumentName);
}
}

/// <summary>
/// Throws an ArgumentNullException if argument is null or an ArgumentException if string is empty.
/// </summary>
/// <param name="argumentName">The argument name.</param>
/// <param name="argument">The argument.</param>
public static void ThrowIfNullOrEmpty(string argumentName, string argument)
{
ThrowIfNull(argumentName, argument);

if (string.IsNullOrEmpty(argument))
{
throw new ArgumentException("Argument '{0}' can't be empty.".With(argumentName), argumentName);
}
}

/// <summary>
/// Format the specified string. Is a String.Format(CultureInfo.InvariantCulture,..) shortcut.
/// </summary>
/// <param name="source">The source string.</param>
/// <param name="args">The arguments.</param>
/// <returns>The formatted string.</returns>
public static string With(this string source, params object[] args)
{
return String.Format(CultureInfo.InvariantCulture, source, args);
}
}
}
39 changes: 0 additions & 39 deletions src/SalesforceSharp/Properties/AssemblyInfo.cs

This file was deleted.

16 changes: 8 additions & 8 deletions src/SalesforceSharp/SalesforceClient.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using HelperSharp;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Linq;
using RestSharp;
using RestSharp.Extensions;
using SalesforceSharp.Extensions;
using SalesforceSharp.Models;
using SalesforceSharp.Security;
using SalesforceSharp.Serialization;
using RestSharp.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;

namespace SalesforceSharp
{
Expand Down
Loading