());
+ }
+
+ [Test()]
+ public void MissingSoapEndPointPropertyFromConfigSection()
+ {
+ FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(requiredPropertiesOnlyConfigFileName);
+ Assert.AreEqual(string.Empty, section.SoapEndPoint);
+ }
+
+ [Test()]
+ public void MissingAuthEndPointPropertyFromConfigSection()
+ {
+ FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(requiredPropertiesOnlyConfigFileName);
+ Assert.AreEqual(string.Empty, section.AuthenticationEndPoint);
+ }
+
+ [Test()]
+ public void MissingRestEndPointPropertyFromConfigSection()
+ {
+ FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(requiredPropertiesOnlyConfigFileName);
+ Assert.AreEqual(string.Empty, section.RestEndPoint);
+ }
+
+ [Test()]
+ public void AllPropertiesSetInConfigSection()
+ {
+ FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(allPropertiesSetConfigFileName);
+ Assert.AreEqual(section.AppSignature, "none");
+ Assert.AreEqual(section.ClientId, "abc");
+ Assert.AreEqual(section.ClientSecret, "cde");
+ Assert.AreEqual(section.SoapEndPoint, "https://soapendpoint.com");
+ Assert.AreEqual(section.AuthenticationEndPoint, "https://authendpoint.com");
+ Assert.AreEqual(section.RestEndPoint, "https://restendpoint.com");
+ }
+
+ [Test]
+ public void AllPropertiesSetButAuthEndpointIsEmpty()
+ {
+ FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(allPropertiesSetButAuthEndpointIsEmptyConfigFileName);
+ var sectionWithDefaultAuthEndpoint = section.WithDefaultAuthEndpoint(DefaultEndpoints.Auth);
+
+ Assert.AreEqual(DefaultEndpoints.Auth, sectionWithDefaultAuthEndpoint.AuthenticationEndPoint);
+ }
+
+ [Test]
+ public void AllPropertiesSetButRestEndpointIsEmpty()
+ {
+ FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(allPropertiesSetButRestEndpointIsEmptyConfigFileName);
+ var sectionWithDefaultRestEndpoint = section.WithDefaultRestEndpoint(DefaultEndpoints.Rest);
+
+ Assert.AreEqual(DefaultEndpoints.Rest, sectionWithDefaultRestEndpoint.RestEndPoint);
+ }
+
+ [Test]
+ public void WithDefaultsDoesNotOverwriteValuesSetInConfig()
+ {
+ FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(allPropertiesSetConfigFileName);
+ section = section
+ .WithDefaultRestEndpoint(DefaultEndpoints.Rest)
+ .WithDefaultAuthEndpoint(DefaultEndpoints.Auth);
+
+ Assert.AreEqual(section.AuthenticationEndPoint, "https://authendpoint.com");
+ Assert.AreEqual(section.RestEndPoint, "https://restendpoint.com");
+ }
+
+ [Test]
+ public void ModifyingAClonedConfigSectionAffectsTheOriginalSectionAndAnyNewInstance()
+ {
+ var section = (FuelSDKConfigurationSection)ConfigurationManager.GetSection("fuelSDK");
+ var clonedSection = (FuelSDKConfigurationSection)section.Clone();
+
+ clonedSection.SoapEndPoint = "https://soapendpoint.com";
+ var newSection = (FuelSDKConfigurationSection)ConfigurationManager.GetSection("fuelSDK");
+
+ Assert.AreEqual(object.ReferenceEquals(section, clonedSection), false);
+ Assert.AreNotSame(section, clonedSection);
+ Assert.AreEqual(section.SoapEndPoint, clonedSection.SoapEndPoint);
+ Assert.AreEqual(section.SoapEndPoint, newSection.SoapEndPoint);
+ }
+ }
+}
diff --git a/FuelSDK-Test/StackKeyTest.cs b/FuelSDK-Test/StackKeyTest.cs
new file mode 100644
index 0000000..c39aa40
--- /dev/null
+++ b/FuelSDK-Test/StackKeyTest.cs
@@ -0,0 +1,19 @@
+using NUnit.Framework;
+
+namespace FuelSDK.Test
+{
+ [TestFixture]
+ public class StackKeyTest
+ {
+ [Test]
+ public void MultipleETClientInstancesForTheSameClientIdAndSecretWillHaveTheSameStackKey()
+ {
+ ETClient client1 = new ETClient();
+ ETClient client2 = new ETClient();
+
+ Assert.IsNotNull(client1.Stack);
+ Assert.IsNotNull(client2.Stack);
+ Assert.AreEqual(client1.Stack, client2.Stack);
+ }
+ }
+}
diff --git a/README.md b/README.md
index a306322..b7c0729 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,26 @@ Salesforce Marketing Cloud Fuel SDK for C#
## Overview ##
The Fuel SDK for C# provides easy access to Salesforce Marketing Cloud's Fuel API Family services, including a collection of REST APIs and a SOAP API. These APIs provide access to Salesforce Marketing Cloud functionality via common collection types.
+## New Features in Version 1.1.0 ##
+* **Added support for your tenant's endpoints - [More Details](https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/your-subdomain-tenant-specific-endpoints.htm) :** The user of the SDK can now configure them through a **App.config** file OR using the “**parameters**” **ETClient** constructor parameter as in the previous version of the SDK. The user of the SDK has to make a copy of the **App.config.transform** file which is found in the **FuelSDK-CSharp** folder, place it in the same folder and rename it to **App.config**. The structure of this file will be the following:
+
+
+<configuration>
+ <configSections>
+ <section name="fuelSDK" type="FuelSDK.FuelSDKConfigurationSection, FuelSDK" />
+ </configSections>
+ <fuelSDK
+ appSignature="<appSignature>"
+ clientId="<clientId>"
+ clientSecret="<clientSecret>"
+ authEndPoint="<authenticationEndPoint>"
+ soapEndPoint="<soapEndPoint>"
+ restEndPoint="<restEndPoint>" />
+</configuration>
+
+
+
+
## New Features in Version 1.0.0 ##
* **code refactor :** code refactored to individual class files. Classes starting with “ET_” are deprecated now and all SDK API objects start with “ET”.
@@ -21,6 +41,12 @@ Project tree structure
* **JWT :** JWT.cs is removed from the project and added as dependency.
+Not specifying the **appSignature** field in the **App.config** file will throw an error if you try to instantiate the **ETClient** class using a **jwt**.
+
+Not specifying the **authEndPoint**, **soapEndPoint** and the **restEndPoint** in the **App.config** file will make the SDK use the default values of these fields that are provided in the **FuelSDKConfigurationSection** class.
+
+Not specifying the **clientId** and the **clientSecret** fields in the **App.config** file will throw an error if you try to instantiate the **ETClient** class.
+
## Requirements ##
- .NET Studio 2013 or higher (WCF)
- .NET Framework 4
@@ -39,7 +65,7 @@ All necessary settings are in App.config.transform file.
## Getting Started ##
The FuelSDK-CSharp solution file includes two projects. One for the actual SDK and one for a web based testing app as an example of how to use the SDK dll and other dependent files.
-Rename the FuelSDK_config.xml.template file in the objsamples project to FuelSDK_config.xml, then edit so you can input the ClientID and Client Secret values provided when you registered your application. If you are building a HubExchange application for the Interactive Marketing Hub then, you must also provide the Application Signature (appsignature). Only change the value for the defaultwsdl configuration item if instructed by Salesforce Marketing Cloud.
+Rename the **App.config.transform** file in the objsamples project to **App.config**, then edit so you can input the ClientID and Client Secret values provided when you registered your application. If you are building a HubExchange application for the Interactive Marketing Hub then, you must also provide the Application Signature (appsignature). Only change the value for the defaultwsdl configuration item if instructed by Salesforce Marketing Cloud.
If you have not registered your application or you need to lookup your Application Key or Application Signature values, please go to App Center at [Code@: Salesforce Marketing Cloud's Developer Community]( https://appcenter-auth.s1.marketingcloudapps.com "CODE@").
@@ -131,7 +157,7 @@ Get Methods also return an addition value to indicate if more information is ava
The objsamples project (included in solution) contains sample calls for all the available functionality.
## Copyright and license ##
-Copyright (c) 2017 Salesforce Marketing Cloud
+Copyright (c) 2018 Salesforce Marketing Cloud
Licensed under the MIT License (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the COPYING file.
diff --git a/nuspecs/FuelSDK-CSharp.nuspec b/nuspecs/FuelSDK-CSharp.nuspec
index a277a54..d56de88 100644
--- a/nuspecs/FuelSDK-CSharp.nuspec
+++ b/nuspecs/FuelSDK-CSharp.nuspec
@@ -2,7 +2,7 @@
SFMC.FuelSDK
- 1.0.0
+ 1.1.0
FuelSDK-CSharp
Salesforce
Salesforce
@@ -11,7 +11,7 @@
false
The Fuel SDK for C# provides easy access to Salesforce Marketing Cloud's (ExactTarge) Fuel API Family services, including a collection of REST APIs and a SOAP API. These APIs provide access to Salesforce Marketing Cloud functionality via common collection types.
- Copyright 2017
+ Copyright 2018
FuelSdk Saleforce Marketing Cloud ExactTarget
en-US