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

[Azure Search] Upgrade Management SDK to version 2.0 #3993

Merged
merged 10 commits into from
Jan 11, 2018
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
1 change: 1 addition & 0 deletions Documentation/sdk-for-net-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Below are the packages maintained in this repository.
| Relay | `Microsoft.Azure.Management.Relay` | [![Relay](https://img.shields.io/nuget/vpre/Microsoft.Azure.Management.Relay.svg)](https://www.nuget.org/packages/Microsoft.Azure.Management.Relay) |
| Resources | `Microsoft.Azure.Management.ResourceManager` | [![Resources](https://img.shields.io/nuget/vpre/Microsoft.Azure.Management.ResourceManager.svg)](https://www.nuget.org/packages/Microsoft.Azure.Management.ResourceManager) |
| Scheduler | `Microsoft.Azure.Management.Scheduler` | [![Scheduler](https://img.shields.io/nuget/vpre/Microsoft.Azure.Management.Scheduler.svg)](https://www.nuget.org/packages/Microsoft.Azure.Management.Scheduler) |
| Search | `Microsoft.Azure.Management.Search` | [![Search](https://img.shields.io/nuget/vpre/Microsoft.Azure.Management.Search.svg)](https://www.nuget.org/packages/Microsoft.Azure.Management.Search) |
| Server Management | `Microsoft.Azure.Management.ServerManagement` | [![Server Management](https://img.shields.io/nuget/vpre/Microsoft.Azure.Management.ServerManagement.svg)](https://www.nuget.org/packages/Microsoft.Azure.Management.ServerManagement) |
| Service Bus | `Microsoft.Azure.Management.ServiceBus` | [![Service Bus](https://img.shields.io/nuget/vpre/Microsoft.Azure.Management.ServiceBus.svg)](https://www.nuget.org/packages/Microsoft.Azure.Management.ServiceBus) |
| Service Fabric | `Microsoft.Azure.Management.ServiceFabric` | [![Service Fabric](https://img.shields.io/nuget/vpre/Microsoft.Azure.Management.ServiceFabric.svg)](https://www.nuget.org/packages/Microsoft.Azure.Management.ServiceFabric) |
Expand Down
7 changes: 7 additions & 0 deletions src/SDKs/Search/AzSdk.RP.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file-->
<PropertyGroup>
<AzureApiTag>Search_2015-08-19;</AzureApiTag>
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void GenerateIfMatchConditionReturnsIfNoneMatchAccessCondition()
Assert.Null(result.IfMatch);
}

public static void CreateOrUpdateIfNotExistsFailsOnExistingResource<T>(
internal static void CreateOrUpdateIfNotExistsFailsOnExistingResource<T>(
Func<T, SearchRequestOptions, AccessCondition, T> createOrUpdateFunc,
Func<T> newResourceDefinition,
Func<T, T> mutateResourceDefinition)
Expand All @@ -132,7 +132,7 @@ public static void CreateOrUpdateIfNotExistsFailsOnExistingResource<T>(
e => e.IsAccessConditionFailed());
}

public static void CreateOrUpdateIfNotExistsSucceedsOnNoResource<T>(
internal static void CreateOrUpdateIfNotExistsSucceedsOnNoResource<T>(
Func<T, SearchRequestOptions, AccessCondition, T> createOrUpdateFunc,
Func<T> newResourceDefinition)
where T : IResourceWithETag
Expand All @@ -145,7 +145,7 @@ public static void CreateOrUpdateIfNotExistsSucceedsOnNoResource<T>(
Assert.NotEmpty(updatedResource.ETag);
}

public static void UpdateIfExistsSucceedsOnExistingResource<T>(
internal static void UpdateIfExistsSucceedsOnExistingResource<T>(
Func<T, SearchRequestOptions, AccessCondition, T> createOrUpdateFunc,
Func<T> newResourceDefinition,
Func<T, T> mutateResourceDefinition)
Expand All @@ -161,7 +161,7 @@ public static void UpdateIfExistsSucceedsOnExistingResource<T>(
Assert.NotEqual(createdResource.ETag, updatedResource.ETag);
}

public static void UpdateIfExistsFailsOnNoResource<T>(
internal static void UpdateIfExistsFailsOnNoResource<T>(
Func<T, SearchRequestOptions, AccessCondition, T> createOrUpdateFunc,
Func<T> newResourceDefinition)
where T : IResourceWithETag
Expand All @@ -177,7 +177,7 @@ public static void UpdateIfExistsFailsOnNoResource<T>(
Assert.Null(resource.ETag);
}

public static void UpdateIfNotChangedSucceedsWhenResourceUnchanged<T>(
internal static void UpdateIfNotChangedSucceedsWhenResourceUnchanged<T>(
Func<T, SearchRequestOptions, AccessCondition, T> createOrUpdateFunc,
Func<T> newResourceDefinition,
Func<T, T> mutateResourceDefinition)
Expand All @@ -194,7 +194,7 @@ public static void UpdateIfNotChangedSucceedsWhenResourceUnchanged<T>(
Assert.NotEqual(createdResource.ETag, updatedResource.ETag);
}

public static void UpdateIfNotChangedFailsWhenResourceChanged<T>(
internal static void UpdateIfNotChangedFailsWhenResourceChanged<T>(
Func<T, SearchRequestOptions, AccessCondition, T> createOrUpdateFunc,
Func<T> newResourceDefinition,
Func<T, T> mutateResourceDefinition)
Expand All @@ -214,7 +214,7 @@ public static void UpdateIfNotChangedFailsWhenResourceChanged<T>(
Assert.NotEqual(createdResource.ETag, updatedResource.ETag);
}

public static void DeleteIfNotChangedWorksOnlyOnCurrentResource<T>(
internal static void DeleteIfNotChangedWorksOnlyOnCurrentResource<T>(
Action<string, SearchRequestOptions, AccessCondition> deleteAction,
Func<T> createResource,
Func<T, T> updateResource,
Expand All @@ -231,7 +231,7 @@ public static void DeleteIfNotChangedWorksOnlyOnCurrentResource<T>(
delete(resourceName, AccessCondition.IfNotChanged(currentResource));
}

public static void DeleteIfExistsWorksOnlyWhenResourceExists<T>(
internal static void DeleteIfExistsWorksOnlyWhenResourceExists<T>(
Action<string, SearchRequestOptions, AccessCondition> deleteAction,
Func<T> createResource,
string resourceName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ public void CanReadEmptyArrays()
{
Document doc = JsonConvert.DeserializeObject<Document>(@"{ ""field"": [] }", _settings);

Assert.Equal(1, doc.Count);
Assert.Single(doc);
string[] fieldValues = Assert.IsType<string[]>(doc["field"]);
Assert.Equal(0, fieldValues.Length);
Assert.Empty(fieldValues);
}

[Fact]
public void CanReadArraysOfStrings()
{
Document doc = JsonConvert.DeserializeObject<Document>(@"{ ""field"": [""hello"", ""goodbye""] }", _settings);

Assert.Equal(1, doc.Count);
Assert.Single(doc);
string[] fieldValues = Assert.IsType<string[]>(doc["field"]);
Assert.Equal(2, fieldValues.Length);
Assert.Equal("hello", fieldValues[0]);
Expand All @@ -104,7 +104,7 @@ public void CanReadGeoPoint()
const string Json = @"{ ""field"": { ""type"": ""Point"", ""coordinates"": [-122.131577, 47.678581] } }";
Document doc = JsonConvert.DeserializeObject<Document>(Json, _settings);

Assert.Equal(1, doc.Count);
Assert.Single(doc);
GeographyPoint fieldValue = Assert.IsAssignableFrom<GeographyPoint>(doc["field"]);
Assert.Equal(-122.131577, fieldValue.Longitude);
Assert.Equal(47.678581, fieldValue.Latitude);
Expand Down Expand Up @@ -137,7 +137,7 @@ public void DateTimeStringsAreReadAsDateTime()

Document doc = JsonConvert.DeserializeObject<Document>(json, _settings);

Assert.Equal(1, doc.Count);
Assert.Single(doc);
Assert.Equal(TestDate, doc["field"]);
}

Expand All @@ -148,7 +148,7 @@ public void CanReadArraysOfMixedTypes()
// Azure Search won't return payloads like this; This test is only for pinning purposes.
Document doc = JsonConvert.DeserializeObject<Document>(@"{ ""field"": [""hello"", 123, 3.14] }", _settings);

Assert.Equal(1, doc.Count);
Assert.Single(doc);
object[] fieldValues = Assert.IsType<object[]>(doc["field"]);
Assert.Equal(3, fieldValues.Length);
Assert.Equal("hello", fieldValues[0]);
Expand All @@ -164,7 +164,7 @@ public void DateTimeStringsInArraysAreReadAsDateTime()

Document doc = JsonConvert.DeserializeObject<Document>(json, _settings);

Assert.Equal(1, doc.Count);
Assert.Single(doc);
object[] fieldValues = Assert.IsType<object[]>(doc["field"]);
Assert.Equal(3, fieldValues.Length);
Assert.Equal("hello", fieldValues[0]);
Expand Down
1 change: 1 addition & 0 deletions src/SDKs/Search/Get-TestMode.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Write-Output "Current test mode is: $Env:AZURE_TEST_MODE"
Loading