public void OcrTestGoogleApiTest() { GoogleCloudApi.JsonCredential = (string)scripter.Variables.GetVariable("credential").GetValue("Ocr:google").Object; var bitmapWithTestText = Resources.testimage; var expectedRectangle = new Rectangle(167, 142, 192, 51); var languages = new List <string>() { "en" }; var timeout = 10000; GoogleCloudApi googleApi = new GoogleCloudApi(); Rectangle foundRectangle = googleApi.RecognizeText(bitmapWithTestText, "animal", languages, timeout); Assert.AreEqual(expectedRectangle, foundRectangle); }
public void OcrTestGoogleApiTest() { GoogleCloudApi.InitializeJsonCredential("G1ANT-Robot", (string)scripter.Variables.GetVariable("credential").GetValue("Ocr:google").Object); var bitmapWithTestText = Resources.testimage; var expectedRectangle = new Rectangle(167, 142, 192, 51); var languages = new List <string>() { "en" }; var timeout = 10000; var googleApi = new GoogleCloudApi(); var foundRectangle = googleApi.FindTextPosition(bitmapWithTestText, "animal", languages, timeout); Assert.AreEqual(expectedRectangle, foundRectangle); }