public void BatchReadFileTest() { using (MockContext context = MockContext.Start(this.GetType().FullName)) { HttpMockServer.Initialize(this.GetType().FullName, "BatchReadFileTest"); string imageUrl = GetTestImageUrl("signage.jpg"); using (IComputerVisionClient client = GetComputerVisionClient(HttpMockServer.CreateInstance())) { BatchReadFileHeaders headers = client.BatchReadFileAsync(imageUrl).Result; Assert.NotNull(headers.OperationLocation); ReadOperationResult readOperationResult = GetRecognitionResultWithPolling(client, headers.OperationLocation); Assert.NotNull(readOperationResult); Assert.Equal(TextOperationStatusCodes.Succeeded, readOperationResult.Status); Assert.NotNull(readOperationResult.RecognitionResults); Assert.Equal(1, readOperationResult.RecognitionResults.Count); var recognitionResult = readOperationResult.RecognitionResults[0]; Assert.Equal(1, recognitionResult.Page); Assert.Equal(250, recognitionResult.Width); Assert.Equal(258, recognitionResult.Height); Assert.Equal(TextRecognitionResultDimensionUnit.Pixel, recognitionResult.Unit); Assert.Equal( new string[] { "520", "WEST", "Seattle" }.OrderBy(t => t), recognitionResult.Lines.Select(line => line.Text).OrderBy(t => t)); Assert.Equal( new string[] { "520", "WEST", "Seattle" }.OrderBy(t => t), recognitionResult.Lines.SelectMany(line => line.Words).Select(word => word.Text).OrderBy(t => t)); Assert.Equal(3, recognitionResult.Lines.Count); } } }