Skip to content

Commit 23d2902

Browse files
committed
chore: Address comments
1 parent fdd629e commit 23d2902

File tree

6 files changed

+106
-1375
lines changed

6 files changed

+106
-1375
lines changed

.bumpversion.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,8 @@ replace = {new_version}
149149

150150
[bumpversion:file:test/VisualRecognition.v4.IntegrationTests/IBM.Watson.VisualRecognition.v4.IntegrationTests.csproj]
151151
search = {current_version}
152-
replace = {new_version}
152+
replace = {new_version}
153+
154+
[bumpversion:file:test/VisualRecognition.v4.UnitTests/IBM.Watson.VisualRecognition.v4.UnitTests.csproj]
155+
search = {current_version}
156+
replace = {new_version}

src/IBM.Watson.VisualRecognition.v4/IVisualRecognitionService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace IBM.Watson.VisualRecognition.v4
2424
{
2525
public partial interface IVisualRecognitionService
2626
{
27-
DetailedResponse<AnalyzeResponse> Analyze(string collectionIds, string features, List<FileWithMetadata> imagesFile = null, List<string> imageUrl = null, float? threshold = null);
27+
DetailedResponse<AnalyzeResponse> Analyze(List<string> collectionIds, List<string> features, List<FileWithMetadata> imagesFile = null, List<string> imageUrl = null, float? threshold = null);
2828
DetailedResponse<Collection> CreateCollection(string name = null, string description = null);
2929
DetailedResponse<CollectionsList> ListCollections();
3030
DetailedResponse<Collection> GetCollection(string collectionId);

src/IBM.Watson.VisualRecognition.v4/VisualRecognitionService.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ public VisualRecognitionService(string versionDate, IAuthenticator authenticator
8282
/// You can also include images with the **images_file** parameter. (optional)</param>
8383
/// <param name="threshold">The minimum score a feature must have to be returned. (optional)</param>
8484
/// <returns><see cref="AnalyzeResponse" />AnalyzeResponse</returns>
85-
public DetailedResponse<AnalyzeResponse> Analyze(string collectionIds, string features, List<FileWithMetadata> imagesFile = null, List<string> imageUrl = null, float? threshold = null)
85+
public DetailedResponse<AnalyzeResponse> Analyze(List<string> collectionIds, List<string> features, List<FileWithMetadata> imagesFile = null, List<string> imageUrl = null, float? threshold = null)
8686
{
87-
if (string.IsNullOrEmpty(collectionIds))
87+
if (collectionIds == null || collectionIds.Count == 0)
8888
{
8989
throw new ArgumentNullException("`collectionIds` is required for `Analyze`");
9090
}
91-
if (string.IsNullOrEmpty(features))
91+
if (features == null || features.Count == 0)
9292
{
9393
throw new ArgumentNullException("`features` is required for `Analyze`");
9494
}
@@ -106,14 +106,14 @@ public DetailedResponse<AnalyzeResponse> Analyze(string collectionIds, string fe
106106

107107
if (collectionIds != null)
108108
{
109-
var collectionIdsContent = new StringContent(collectionIds, Encoding.UTF8, HttpMediaType.TEXT_PLAIN);
109+
var collectionIdsContent = new StringContent(string.Join(",", collectionIds.ToArray()), Encoding.UTF8, HttpMediaType.TEXT_PLAIN);
110110
collectionIdsContent.Headers.ContentType = null;
111111
formData.Add(collectionIdsContent, "collection_ids");
112112
}
113113

114114
if (features != null)
115115
{
116-
var featuresContent = new StringContent(features, Encoding.UTF8, HttpMediaType.TEXT_PLAIN);
116+
var featuresContent = new StringContent(string.Join(",", features.ToArray()), Encoding.UTF8, HttpMediaType.TEXT_PLAIN);
117117
featuresContent.Headers.ContentType = null;
118118
formData.Add(featuresContent, "features");
119119
}

test/VisualRecognition.v4.IntegrationTests/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// associated with an assembly.
88
[assembly: AssemblyConfiguration("")]
99
[assembly: AssemblyCompany("IBM")]
10-
[assembly: AssemblyProduct("IBM.Watson.VisualRecognition.v3.IntegrationTests")]
10+
[assembly: AssemblyProduct("IBM.Watson.VisualRecognition.v4.IntegrationTests")]
1111
[assembly: AssemblyTrademark("")]
1212

1313
// Setting ComVisible to false makes the types in this assembly not visible

test/VisualRecognition.v4.IntegrationTests/VisualRecognitionServiceIntegrationTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ public void Analyze_Success()
8484

8585
service.WithHeader("X-Watson-Test", "1");
8686
analyzeResult = service.Analyze(
87-
collectionIds: giraffeCollectionId + "," + turtleCollectionId,
88-
features: "objects",
87+
collectionIds: new List<string>() { giraffeCollectionId, turtleCollectionId },
88+
features: new List<string>() { "objects" },
8989
imagesFile: imagesFile);
9090
}
9191
}
@@ -300,7 +300,7 @@ public void Training_Success()
300300
Assert.IsTrue(addTrainingDataResult.Result.Objects[0]._Object == objectName);
301301
}
302302
#endregion
303-
303+
304304
#region Delete labeled data
305305
[TestMethod]
306306
public void DeleteUserData()

0 commit comments

Comments
 (0)