public async Task DetectImageProperties() { ImageAnnotatorClient client = new FakeImageAnnotator(); Assert.Equal(s_allAnnotationsResponse.ImagePropertiesAnnotation, client.DetectImageProperties(s_allAnnotationsImage)); Assert.Equal(s_allAnnotationsResponse.ImagePropertiesAnnotation, await client.DetectImagePropertiesAsync(s_allAnnotationsImage)); }
public async Task DetectDocumentText() { ImageAnnotatorClient client = new FakeImageAnnotator(); Assert.Equal(s_allAnnotationsResponse.FullTextAnnotation, client.DetectDocumentText(s_allAnnotationsImage)); Assert.Equal(s_allAnnotationsResponse.FullTextAnnotation, await client.DetectDocumentTextAsync(s_allAnnotationsImage)); }
public async Task DetectWebInformation() { ImageAnnotatorClient client = new FakeImageAnnotator(); Assert.Equal(s_allAnnotationsResponse.WebDetection, client.DetectWebInformation(s_allAnnotationsImage)); Assert.Equal(s_allAnnotationsResponse.WebDetection, await client.DetectWebInformationAsync(s_allAnnotationsImage)); }
public async Task DetectSafeSearch() { ImageAnnotatorClient client = new FakeImageAnnotator(); Assert.Equal(s_allAnnotationsResponse.SafeSearchAnnotation, client.DetectSafeSearch(s_allAnnotationsImage)); Assert.Equal(s_allAnnotationsResponse.SafeSearchAnnotation, await client.DetectSafeSearchAsync(s_allAnnotationsImage)); }
public async Task DetectFaces() { ImageAnnotatorClient client = new FakeImageAnnotator(); var image = CreateFakeImage(s_allAnnotationsResponse); await AssertRepeatedAnnotation(client.DetectFaces, client.DetectFacesAsync, s_allAnnotationsResponse.FaceAnnotations); }
public async Task Annotate() { ImageAnnotatorClient client = new FakeImageAnnotator(); var request = new AnnotateImageRequest { Image = s_allAnnotationsImage, Features = { new Feature { Type = FeatureType.FaceDetection }, new Feature { Type = FeatureType.LogoDetection, MaxResults = 1 } } }; var expectedResponse = new AnnotateImageResponse { FaceAnnotations = { s_allAnnotationsResponse.FaceAnnotations }, LogoAnnotations = { s_allAnnotationsResponse.LogoAnnotations.Take(1) } }; Assert.Equal(expectedResponse, client.Annotate(request)); Assert.Equal(expectedResponse, await client.AnnotateAsync(request)); }
public async Task DetectLandmarks() { ImageAnnotatorClient client = new FakeImageAnnotator(); await AssertRepeatedAnnotation(client.DetectLandmarks, client.DetectLandmarksAsync, s_allAnnotationsResponse.LandmarkAnnotations); }
public async Task DetectText() { ImageAnnotatorClient client = new FakeImageAnnotator(); await AssertRepeatedAnnotation(client.DetectText, client.DetectTextAsync, s_allAnnotationsResponse.TextAnnotations); }