diff --git a/build.cake b/build.cake
index 3b09f9b..a97f242 100644
--- a/build.cake
+++ b/build.cake
@@ -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(() =>
diff --git a/src/SalesforceSharp.FunctionalTests/SalesforceSharp.FunctionalTests.csproj b/src/SalesforceSharp.FunctionalTests/SalesforceSharp.FunctionalTests.csproj
index 0dfc447..08a7565 100644
--- a/src/SalesforceSharp.FunctionalTests/SalesforceSharp.FunctionalTests.csproj
+++ b/src/SalesforceSharp.FunctionalTests/SalesforceSharp.FunctionalTests.csproj
@@ -1,6 +1,6 @@
-
+
Debug
AnyCPU
@@ -38,23 +38,21 @@
false
-
- False
- ..\packages\HelperSharp.0.0.4.1\lib\net35\HelperSharp.dll
+
+ ..\packages\HelperSharp.0.0.4.2\lib\net35\HelperSharp.dll
-
- ..\packages\TestSharp.1.0.2\lib\net40\Ionic.Utils.Zip.dll
+
+ ..\packages\TestSharp.1.0.3\lib\net40\Ionic.Utils.Zip.dll
-
- False
- ..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll
+
+ ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
-
- ..\packages\NUnit.3.12.0\lib\net40\nunit.framework.dll
+
+ ..\packages\NUnit.3.13.2\lib\net45\nunit.framework.dll
-
- ..\packages\TestSharp.1.0.2\lib\net40\TestSharp.dll
+
+ ..\packages\TestSharp.1.0.3\lib\net40\TestSharp.dll
@@ -74,7 +72,7 @@
- {0EA33E69-D046-42AF-9BF3-4B0F49EEA1D6}
+ {25138b0a-8016-4777-a189-a951a0602790}
SalesforceSharp
@@ -84,6 +82,6 @@
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}.
-
+
\ No newline at end of file
diff --git a/src/SalesforceSharp.FunctionalTests/packages.config b/src/SalesforceSharp.FunctionalTests/packages.config
index f697c73..dd20b82 100644
--- a/src/SalesforceSharp.FunctionalTests/packages.config
+++ b/src/SalesforceSharp.FunctionalTests/packages.config
@@ -1,7 +1,7 @@
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/src/SalesforceSharp.UnitTests/SalesforceSharp.UnitTests.csproj b/src/SalesforceSharp.UnitTests/SalesforceSharp.UnitTests.csproj
index 8409a60..98039ab 100644
--- a/src/SalesforceSharp.UnitTests/SalesforceSharp.UnitTests.csproj
+++ b/src/SalesforceSharp.UnitTests/SalesforceSharp.UnitTests.csproj
@@ -1,6 +1,6 @@
-
+
Debug
AnyCPU
@@ -43,22 +43,22 @@
false
-
- ..\packages\TestSharp.1.0.2\lib\net40\Ionic.Utils.Zip.dll
+
+ ..\packages\TestSharp.1.0.3\lib\net40\Ionic.Utils.Zip.dll
-
- ..\packages\NUnit.3.12.0\lib\net40\nunit.framework.dll
+
+ ..\packages\NUnit.3.13.2\lib\net45\nunit.framework.dll
-
- False
- ..\packages\RestSharp.105.0.1\lib\net4\RestSharp.dll
+
+ ..\packages\RestSharp.106.12.0\lib\net452\RestSharp.dll
..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll
-
- ..\packages\TestSharp.1.0.2\lib\net40\TestSharp.dll
+
+
+ ..\packages\TestSharp.1.0.3\lib\net40\TestSharp.dll
@@ -111,7 +111,7 @@
- {0EA33E69-D046-42AF-9BF3-4B0F49EEA1D6}
+ {25138b0a-8016-4777-a189-a951a0602790}
SalesforceSharp
@@ -119,6 +119,6 @@
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}.
-
+
\ No newline at end of file
diff --git a/src/SalesforceSharp.UnitTests/Security/UsernamePasswordAuthenticationFlowTest.cs b/src/SalesforceSharp.UnitTests/Security/UsernamePasswordAuthenticationFlowTest.cs
index 7e1715b..6a714bd 100644
--- a/src/SalesforceSharp.UnitTests/Security/UsernamePasswordAuthenticationFlowTest.cs
+++ b/src/SalesforceSharp.UnitTests/Security/UsernamePasswordAuthenticationFlowTest.cs
@@ -77,7 +77,7 @@ public void Authenticate_Success_AuthenticationInfo()
var restClient = MockRepository.GenerateMock();
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);
diff --git a/src/SalesforceSharp.UnitTests/packages.config b/src/SalesforceSharp.UnitTests/packages.config
index d732fb9..6b6caba 100644
--- a/src/SalesforceSharp.UnitTests/packages.config
+++ b/src/SalesforceSharp.UnitTests/packages.config
@@ -1,14 +1,14 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/src/SalesforceSharp.nuspec b/src/SalesforceSharp.nuspec
index 3098425..0120052 100644
--- a/src/SalesforceSharp.nuspec
+++ b/src/SalesforceSharp.nuspec
@@ -13,14 +13,14 @@
Updated with latest pull-requests: https://github.com/giacomelli/SalesforceSharp/issues?page=1&state=closed
salesforce rest clientlibrary
-
-
-
+
+
+
+
+
-
-
-
+
\ No newline at end of file
diff --git a/src/SalesforceSharp.sln b/src/SalesforceSharp.sln
index 696df0d..717923a 100644
--- a/src/SalesforceSharp.sln
+++ b/src/SalesforceSharp.sln
@@ -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
@@ -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
diff --git a/src/SalesforceSharp/ExceptionHelper.cs b/src/SalesforceSharp/ExceptionHelper.cs
new file mode 100644
index 0000000..61a1f79
--- /dev/null
+++ b/src/SalesforceSharp/ExceptionHelper.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Globalization;
+
+namespace SalesforceSharp.Extensions
+{
+ ///
+ /// Exception helper.
+ ///
+ public static class ExceptionHelper
+ {
+ ///
+ /// Throws an ArgumentNullException if argument is null.
+ ///
+ /// The argument name.
+ /// The argument.
+ public static void ThrowIfNull(string argumentName, object argument)
+ {
+ if (argument == null)
+ {
+ throw new ArgumentNullException(argumentName);
+ }
+ }
+
+ ///
+ /// Throws an ArgumentNullException if argument is null or an ArgumentException if string is empty.
+ ///
+ /// The argument name.
+ /// The argument.
+ 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);
+ }
+ }
+
+ ///
+ /// Format the specified string. Is a String.Format(CultureInfo.InvariantCulture,..) shortcut.
+ ///
+ /// The source string.
+ /// The arguments.
+ /// The formatted string.
+ public static string With(this string source, params object[] args)
+ {
+ return String.Format(CultureInfo.InvariantCulture, source, args);
+ }
+ }
+}
diff --git a/src/SalesforceSharp/Properties/AssemblyInfo.cs b/src/SalesforceSharp/Properties/AssemblyInfo.cs
deleted file mode 100644
index 7ae1a78..0000000
--- a/src/SalesforceSharp/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// 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("SalesforceSharp")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SalesforceSharp")]
-[assembly: AssemblyCopyright("Copyright © 2013")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("a6658173-277b-4a8f-89fa-4c097b505e46")]
-
-// 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.1.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]
-
-[assembly: InternalsVisibleTo("SalesforceSharp.UnitTests")]
-[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
diff --git a/src/SalesforceSharp/SalesforceClient.cs b/src/SalesforceSharp/SalesforceClient.cs
index 8438326..08f8a44 100644
--- a/src/SalesforceSharp/SalesforceClient.cs
+++ b/src/SalesforceSharp/SalesforceClient.cs
@@ -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
{
diff --git a/src/SalesforceSharp/SalesforceSharp.csproj b/src/SalesforceSharp/SalesforceSharp.csproj
index fa7241f..5b6ba7b 100644
--- a/src/SalesforceSharp/SalesforceSharp.csproj
+++ b/src/SalesforceSharp/SalesforceSharp.csproj
@@ -1,97 +1,27 @@
-
-
-
+
+
- Debug
- AnyCPU
- {0EA33E69-D046-42AF-9BF3-4B0F49EEA1D6}
- Library
- Properties
- SalesforceSharp
- SalesforceSharp
- v4.5
- 512
- ..\
- true
-
- 12.0.0
- 2.0
-
-
- true
- full
- false
- bin\Debug\
- TRACE;DEBUG
- prompt
- 4
- true
- bin\Debug\SalesforceSharp.XML
- false
- false
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- true
- bin\Release\SalesforceSharp.XML
- false
+ netstandard2.0
+ 1.2.0.0
+ Copyright © 2013
+ 1.2.0.0
+ 1.2.0.0
+ true
+
-
- ..\packages\HelperSharp.0.0.4.1\lib\net35\HelperSharp.dll
-
-
- ..\packages\Newtonsoft.Json.6.0.6\lib\net45\Newtonsoft.Json.dll
-
-
- ..\packages\RestSharp.105.0.1\lib\net4\RestSharp.dll
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
- Designer
-
+
+
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/SalesforceSharp/Security/UsernamePasswordAuthenticationFlow.cs b/src/SalesforceSharp/Security/UsernamePasswordAuthenticationFlow.cs
index 1047e12..1a26b08 100644
--- a/src/SalesforceSharp/Security/UsernamePasswordAuthenticationFlow.cs
+++ b/src/SalesforceSharp/Security/UsernamePasswordAuthenticationFlow.cs
@@ -1,8 +1,8 @@
-using System.Net;
-using HelperSharp;
-using RestSharp;
+using RestSharp;
+using SalesforceSharp.Extensions;
using SalesforceSharp.Serialization;
using System;
+using System.Net;
namespace SalesforceSharp.Security
{