diff --git a/src/SDKs/CognitiveServices/dataPlane/Personalizer/AzSdk.RP.props b/src/SDKs/CognitiveServices/dataPlane/Personalizer/AzSdk.RP.props
new file mode 100644
index 0000000000000..39645fa6dc051
--- /dev/null
+++ b/src/SDKs/CognitiveServices/dataPlane/Personalizer/AzSdk.RP.props
@@ -0,0 +1,7 @@
+
+
+
+
+ $(PackageTags);$(CommonTags);$(AzureApiTag);
+
+
\ No newline at end of file
diff --git a/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/BaseTests.cs b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/BaseTests.cs
new file mode 100644
index 0000000000000..80f740ed6be23
--- /dev/null
+++ b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/BaseTests.cs
@@ -0,0 +1,20 @@
+using System.Net.Http;
+
+namespace Microsoft.Azure.CognitiveServices.Personalizer.Tests
+{
+ public abstract class BaseTests
+ {
+ public static bool IsTestTenant = false;
+ // BaseEndpoint only contains protocol and hostname
+ private static string BaseEndpoint = "http://localhost:5000";
+ private static string ApiKey = "000";
+
+ protected IPersonalizerClient GetClient(DelegatingHandler handler)
+ {
+ return new PersonalizerClient(new ApiKeyServiceClientCredentials(ApiKey), handlers: handler)
+ {
+ Endpoint = BaseEndpoint
+ };
+ }
+ }
+}
diff --git a/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer.Tests.csproj b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer.Tests.csproj
new file mode 100644
index 0000000000000..6203cbf5278d8
--- /dev/null
+++ b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer.Tests.csproj
@@ -0,0 +1,25 @@
+
+
+
+ Microsoft.Azure.CognitiveServices.Personalizer.Tests Class Library
+ Microsoft.Azure.CognitiveServices.Personalizer.Tests
+ 1.0.0
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
+
+
diff --git a/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/ConfigurationsTests.cs b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/ConfigurationsTests.cs
new file mode 100644
index 0000000000000..4785b5c597c15
--- /dev/null
+++ b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/ConfigurationsTests.cs
@@ -0,0 +1,123 @@
+using Microsoft.Azure.CognitiveServices.Personalizer.Models;
+using Microsoft.Azure.Test.HttpRecorder;
+using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
+using Xunit;
+using System;
+using System.Threading.Tasks;
+
+namespace Microsoft.Azure.CognitiveServices.Personalizer.Tests
+{
+ public class ConfigurationsTests : BaseTests
+ {
+ [Fact]
+ public async Task GetServiceConfiguration()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "GetServiceConfiguration");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ ServiceConfiguration defaultConfig = await client.ServiceConfiguration.GetAsync();
+ Assert.Equal("00:01:00", defaultConfig.RewardWaitTime);
+ Assert.Equal("01:00:00", defaultConfig.ModelExportFrequency);
+ Assert.Equal(0D, defaultConfig.DefaultReward);
+ Assert.Equal(0.2, defaultConfig.ExplorationPercentage);
+ Assert.Equal(0, defaultConfig.LogRetentionDays);
+ }
+ }
+
+ [Fact]
+ public async Task UpdateServiceConfiguration()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "UpdateServiceConfiguration");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ TimeSpan newExperimentalUnitDuration = TimeSpan.FromMinutes(1);
+ TimeSpan modelExportFrequency = TimeSpan.FromHours(1);
+ double newDefaultReward = 1.0;
+ string newRewardFuntion = "average";
+ double newExplorationPercentage = 0.2f;
+
+
+ var config = new ServiceConfiguration
+ {
+ RewardAggregation = newRewardFuntion,
+ ModelExportFrequency = modelExportFrequency.ToString(),
+ DefaultReward = newDefaultReward,
+ RewardWaitTime = newExperimentalUnitDuration.ToString(),
+ ExplorationPercentage = newExplorationPercentage
+ };
+
+
+ ServiceConfiguration result = await client.ServiceConfiguration.UpdateAsync(config);
+
+ Assert.Equal(config.DefaultReward, result.DefaultReward);
+ Assert.True(Math.Abs(config.ExplorationPercentage - result.ExplorationPercentage) < 1e-3);
+ Assert.Equal(config.ModelExportFrequency, result.ModelExportFrequency);
+ Assert.Equal(config.RewardAggregation, result.RewardAggregation);
+ Assert.Equal(config.RewardWaitTime, result.RewardWaitTime);
+ }
+ }
+
+ [Fact]
+ public async Task GetPolicy()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "GetPolicy");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ PolicyContract policy = await client.Policy.GetAsync();
+
+ Assert.Equal("app1", policy.Name);
+ Assert.Equal("--cb_explore_adf --quadratic GT --quadratic MR --quadratic GR --quadratic ME --quadratic OT --quadratic OE --quadratic OR --quadratic MS --quadratic GX --ignore A --cb_type ips --epsilon 0.2",
+ policy.Arguments);
+ }
+ }
+
+ [Fact]
+ public async Task UpdatePolicy()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "UpdatePolicy");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ var policy = new PolicyContract
+ {
+ Name = "app1",
+ Arguments = "--cb_explore_adf --quadratic GT --quadratic MR --quadratic GR --quadratic ME --quadratic OT --quadratic OE --quadratic OR --quadratic MS --quadratic GX --ignore A --cb_type ips --epsilon 0.2"
+ };
+
+ var updatedPolicy = await client.Policy.UpdateAsync(policy);
+
+ Assert.NotNull(updatedPolicy);
+ Assert.Equal(policy.Arguments, updatedPolicy.Arguments);
+
+ }
+ }
+
+ [Fact]
+ public async Task DeletePolicy()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "DeletePolicy");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ PolicyContract policy = await client.Policy.DeleteAsync();
+
+ Assert.Equal("--cb_explore_adf --quadratic GT --quadratic MR --quadratic GR --quadratic ME --quadratic OT --quadratic OE --quadratic OR --quadratic MS --quadratic GX --ignore A --cb_type ips --epsilon 0.2",
+ policy.Arguments);
+
+ }
+ }
+ }
+}
diff --git a/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/EvaluationsTests.cs b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/EvaluationsTests.cs
new file mode 100644
index 0000000000000..f15fa34f5123b
--- /dev/null
+++ b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/EvaluationsTests.cs
@@ -0,0 +1,90 @@
+using Microsoft.Azure.CognitiveServices.Personalizer.Models;
+using Microsoft.Azure.Test.HttpRecorder;
+using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
+using Xunit;
+using System.Collections.Generic;
+using System;
+using System.Threading.Tasks;
+
+namespace Microsoft.Azure.CognitiveServices.Personalizer.Tests
+{
+ public class EvaluationsTests : BaseTests
+ {
+ [Fact]
+ public void GetEvaluations()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "GetEvaluations");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ IList evaluations = client.Evaluations.List();
+
+ Assert.True(evaluations.Count > 0);
+ Assert.Equal("myFirstEvaluation", evaluations[0].Name);
+ }
+ }
+
+ [Fact]
+ public void CreateEvaluation()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "CreateEvaluation");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ var evaluation = new EvaluationContract
+ {
+ Name = "myFirstEvaluation",
+ StartTime = new DateTime(2018, 12, 19),
+ EndTime = new DateTime(2019, 1, 19),
+ EnableOfflineExperimentation = true,
+ Policies = new PolicyContract[]
+ {
+ new PolicyContract
+ {
+ Name = "Custom Policy 1",
+ Arguments = "--cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5"
+ }
+ }
+ };
+
+ Evaluation createdEvaluation = client.Evaluations.Create(evaluation);
+
+ Assert.Equal(evaluation.Name, createdEvaluation.Name);
+ }
+ }
+
+ [Fact]
+ public void GetEvaluation()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "GetEvaluation");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ string evaluationId = "0f3cf6a9-f33f-4bb0-967e-3607cefef74e";
+ Evaluation evaluation = client.Evaluations.Get(evaluationId);
+
+ Assert.Equal(evaluationId, evaluation.Id);
+ }
+ }
+
+ [Fact]
+ public void DeleteEvaluation()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "DeleteEvaluation");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ string evaluationId = "b58c6d92-b727-48c1-9487-4be2782c9e0a";
+ client.Evaluations.Delete(evaluationId);
+ }
+ }
+ }
+}
diff --git a/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/LogsTests.cs b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/LogsTests.cs
new file mode 100644
index 0000000000000..538df52214d0f
--- /dev/null
+++ b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/LogsTests.cs
@@ -0,0 +1,40 @@
+using Microsoft.Azure.CognitiveServices.Personalizer.Models;
+using Microsoft.Azure.Test.HttpRecorder;
+using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
+using Xunit;
+using System;
+using System.Threading.Tasks;
+
+namespace Microsoft.Azure.CognitiveServices.Personalizer.Tests
+{
+ public class LogsTests : BaseTests
+ {
+ [Fact]
+ public async Task GetLogsProperties()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "GetLogsProperties");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ LogsProperties properties = await client.Log.GetPropertiesAsync();
+ Assert.Equal(new DateTime(2019, 04, 27), new DateTime(properties.DateRange.FromProperty.Value.Year, properties.DateRange.FromProperty.Value.Month, properties.DateRange.FromProperty.Value.Day));
+ Assert.Equal(new DateTime(2019, 04, 28), new DateTime(properties.DateRange.To.Value.Year, properties.DateRange.To.Value.Month, properties.DateRange.To.Value.Day));
+ }
+ }
+
+ [Fact]
+ public async Task DeleteLogs()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "DeleteLogs");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ await client.Log.DeleteAsync();
+ }
+ }
+ }
+}
diff --git a/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/ModelTests.cs b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/ModelTests.cs
new file mode 100644
index 0000000000000..4624d243bd39c
--- /dev/null
+++ b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/ModelTests.cs
@@ -0,0 +1,54 @@
+using Microsoft.Azure.CognitiveServices.Personalizer.Models;
+using Microsoft.Azure.Test.HttpRecorder;
+using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
+using Xunit;
+using System.IO;
+using System.Threading.Tasks;
+
+namespace Microsoft.Azure.CognitiveServices.Personalizer.Tests
+{
+ public class ModelTests : BaseTests
+ {
+ [Fact]
+ public async Task GetModel()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "GetModel");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ Stream stream = await client.Model.GetAsync();
+ Assert.NotEqual(stream.ReadByte(), -1);
+ }
+ }
+
+ [Fact]
+ public async Task DeleteModel()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "DeleteModel");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ await client.Model.DeleteAsync();
+ }
+ }
+
+ [Fact]
+ public async Task GetModelProperties()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "GetModelProperties");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ ModelProperties modelProperties = await client.Model.GetPropertiesAsync();
+ Assert.True(modelProperties.CreationTime != null);
+ Assert.True(modelProperties.LastModifiedTime != null);
+ }
+ }
+ }
+}
diff --git a/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/RankNullParametersTest.cs b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/RankNullParametersTest.cs
new file mode 100644
index 0000000000000..791b4abb03cb8
--- /dev/null
+++ b/src/SDKs/CognitiveServices/dataPlane/Personalizer/Personalizer.Tests/Personalizer/RankNullParametersTest.cs
@@ -0,0 +1,43 @@
+using Microsoft.Azure.Test.HttpRecorder;
+using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Microsoft.Azure.CognitiveServices.Personalizer.Models;
+using Xunit;
+
+namespace Microsoft.Azure.CognitiveServices.Personalizer.Tests
+{
+ public class RankNullParametersTest : BaseTests
+ {
+ [Fact]
+ public async Task RankNullParameters()
+ {
+ using (MockContext.Start(this.GetType().FullName))
+ {
+ HttpMockServer.Initialize(this.GetType().FullName, "RankNullParameters");
+
+ IPersonalizerClient client = GetClient(HttpMockServer.CreateInstance());
+
+ IList actions = new List();
+ actions.Add(new RankableAction
+ {
+ Id = "Person",
+ Features =
+ new List