public void PokemonNameCorrections() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "Amonitas.jpg"); Assert.AreEqual(".raids add \"Einheitskreis Skulptur\" \"Amonitas\" 20:5", text, true); // Raidboss blocks part of the name text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "Gundeldinger Krippe - Ho-Oh.png"); Assert.AreEqual(".raids add \"Gundeldinger Krippe\" \"Ho-Oh\" 2:43", text, true); // Raidboss blocks part of the name text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "HoOzh.png"); Assert.AreEqual(".raids add \"Flying Bicycle\" \"Ho-Oh\" 23:26", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "Karpador.png"); Assert.AreEqual(".raids add \"Flying Bicycle\" \"Karpador\" 4:2", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "Absol-Theilsiefje.png"); Assert.AreEqual(".raids add \"Theilsiefje Säule\" \"Absol\" 44:24", text, true); // Raidboss blocks part of the name - Could be possible to fix text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "HoOhAsAmonitas.png"); Assert.AreEqual(".raids add \"Steinmann am Rhein \" \"Ho-Oh\" 25:16", text, true); // Raidboss blocks part of the name -- No way this is gonna work ^^ //text = GetOcrResult(ocrService, basePath + "BHF Pratteln - Ho-Oh.png", engine); //Assert.AreEqual(".raids add \"BHF Pratteln\" \"Ho-Oh\" 44:36", text, true); } }
public void BottomMenuBar1080x1920Correction() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BottomMenuBar-Boss-1080x1920.jpg"); Assert.AreEqual(".raids add \"St. Johanns-Tor\" \"Walraisa\" 23:36", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BottomMenuBar-Egg5-1080x1920.jpg"); Assert.AreEqual(".raids add \"Spalentor\" \"5\" 28:28", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BottomMenuBar-Egg4-1080x1920.jpg"); Assert.AreEqual(".raids add \"Organspender Gedenkstein\" \"4\" 36:21", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BossWithMenu1080X1920.png"); Assert.AreEqual(".raids add \"International Imaginary Museum\" \"Kokowei\" 34:55", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "GymNameNotRecognized1080X1920.jpg"); Assert.AreEqual(".raids add \"Kleinbasler Basiliskenbrünnchen\" \"5\" 37:51", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BottomBarSmall1080x1920Level5.jpg"); Assert.AreEqual(".raids add \"FC Münchenstein Sportanlage AU\" \"5\" 22:24", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BottomBarSmall1080x1920Level5Blumenrad.jpg"); Assert.AreEqual(".raids add \"Blumenrad\" \"5\" 52:18", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BottomBarSmall1080x1920Regice.jpg"); Assert.AreEqual(".raids add \"Kirche Schulstrasse\" \"Regice\" 20:30", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BottomBar1080x1920Level5.jpg"); Assert.AreEqual(".raids add \"Gundeldinger Krippe\" \"5\" 24:59", text, true); } }
public void PokemonNameCorrections() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = GetOcrService(context); var text = GetOcrResultString(ocrService, "Amonitas.jpg"); Assert.AreEqual(".raids add \"Einheitskreis Skulptur\" \"Amonitas\" 20:5", text, true); // Raidboss blocks part of the name text = GetOcrResultString(ocrService, "Gundeldinger Krippe - Ho-Oh.png"); Assert.AreEqual(".raids add \"Gundeldinger Krippe\" \"Ho-Oh\" 2:43", text, true); // Raidboss blocks part of the name text = GetOcrResultString(ocrService, "HoOzh.png"); Assert.AreEqual(".raids add \"Flying Bicycle\" \"Ho-Oh\" 23:26", text, true); text = GetOcrResultString(ocrService, "Karpador.png"); Assert.AreEqual(".raids add \"Flying Bicycle\" \"Karpador\" 4:2", text, true); text = GetOcrResultString(ocrService, "HoOhAsAmonitas.png"); Assert.AreEqual(".raids add \"Steinmann am Rhein \" \"Ho-Oh\" 25:16", text, true); // Raidboss blocks part of the name -- No way this is gonna work ^^ //text = GetOcrResult(ocrService, "BHF Pratteln - Ho-Oh.png", engine); //Assert.AreEqual(".raids add \"BHF Pratteln\" \"Ho-Oh\" 44:36", text, true); } }
public void Ric1080X2160BottomBar() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = GetOcrResultString(ocrService, "1080x2160Level4Instead5.png"); Assert.AreEqual(".raids add \"des Zeichners Zeichnung\" \"5\" 23:17", text, true); // The gyms for the following tests do not exist, so just test the results on their own var interactiveResult = GetOcrResult(ocrService, "DortmundLevel5Egg.jpg"); Assert.AreEqual(interactiveResult.Result.EggLevel.GetFirst(), 5); Assert.AreEqual(interactiveResult.Result.EggTimer.GetFirst(), new TimeSpan(0, 54, 17)); interactiveResult = GetOcrResult(ocrService, "DortmundLevel4Egg.jpg"); Assert.AreEqual(interactiveResult.Result.EggLevel.GetFirst(), 4); Assert.AreEqual(interactiveResult.Result.EggTimer.GetFirst(), new TimeSpan(0, 3, 19)); interactiveResult = GetOcrResult(ocrService, "DortmundBossMeditie.jpg"); Assert.AreEqual(interactiveResult.Result.Pokemon.OcrValue, "Meditie"); Assert.AreEqual(interactiveResult.Result.RaidTimer.GetFirst(), new TimeSpan(0, 13, 40)); interactiveResult = GetOcrResult(ocrService, "BottomMenu1080x2160Boss.png"); Assert.AreEqual(interactiveResult.Result.Pokemon.OcrValue, "Walraisa"); Assert.AreEqual(interactiveResult.Result.RaidTimer.GetFirst(), new TimeSpan(0, 35, 31)); } }
public void BottomMenuBar1080X1920Correction() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = GetOcrResultString(ocrService, "BottomMenuBar-Boss-1080x1920.jpg"); Assert.AreEqual(".raids add \"St. Johanns-Tor\" \"Walraisa\" 23:36", text, true); text = GetOcrResultString(ocrService, "BottomMenuBar-Egg5-1080x1920.jpg"); Assert.AreEqual(".raids add \"Spalentor\" \"5\" 28:28", text, true); text = GetOcrResultString(ocrService, "BottomMenuBar-Egg4-1080x1920.jpg"); Assert.AreEqual(".raids add \"Organspender Gedenkstein\" \"4\" 36:21", text, true); text = GetOcrResultString(ocrService, "BossWithMenu1080X1920.png"); Assert.AreEqual(".raids add \"International Imaginary Museum\" \"Kokowei\" 34:55", text, true); text = GetOcrResultString(ocrService, "GymNameNotRecognized1080X1920.jpg"); Assert.AreEqual(".raids add \"Kleinbasler Basiliskenbrünnchen\" \"5\" 37:51", text, true); text = GetOcrResultString(ocrService, "BottomBarSmall1080x1920Level5.jpg"); Assert.AreEqual(".raids add \"FC Münchenstein Sportanlage AU\" \"5\" 22:24", text, true); // TODO: No idea how, but the gym name has to be made more readable //text = GetOcrResultString(ocrService, "1080x1920WrongGymNameDetected.jpg"); //Assert.AreEqual(".raids add \"Monument de Strasbourg (Elisabethenanlage)\" \"Blitza\" 22:38", text, true); } }
public void WithoutMenu1080X2220() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = GetOcrResultString(ocrService, "Egg1080x2220.jpg"); Assert.AreEqual(".raids add \"Moderne Konferenz\" \"5\" 55:9", text, true); } }
public void CpChecks() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "HoOhAsAmonitas.png"); Assert.AreEqual(".raids add \"Steinmann am Rhein \" \"Ho-Oh\" 25:16", text, true); } }
public void BottomBarSmall1080X1920() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "WithoutMenu1080x1920.jpg"); Assert.AreEqual(".raids add \"St. Johanns Ring Antique House\" \"2\" 40:13", text, true); } }
public void BottomMenu1080X2240() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = GetOcrResultString(ocrService, "1080x2240RaidNichtErkannt.jpg"); Assert.AreEqual(".raids add \"Evang. Meth. Kirche Allschwilerplatz\" \"5\" 6:18", text, true); } }
public void BottomMenu1440X2960() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "GalaxyS9WithMenu.jpg"); Assert.AreEqual(".raids add \"Einheitskreis Skulptur\" \"Amonitas\" 27:5", text, true); } }
public void WithoutMenu1440X2960() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = GetOcrResultString(ocrService, "1440x2960RaidNichtErkannt.jpg"); Assert.AreEqual(".raids add \"ABB Toro\" \"5\" 48:27", text, true); } }
public void BottomMenu900X1600() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US"); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "Nexus900x1600Boss.png"); Assert.AreEqual(".raids add \"Helix Fountain\" \"Snorunt\" 41:40", text, true); } }
public void Ntx_BottomMenu1080X2160() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US"); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BottomMenu1080x2160Level1Instead2.png"); Assert.AreEqual(".raids add \"Sundown Ranch Lake\" \"5\" 44:15", text, true); } }
public void Ntx_WithoutMenu750X1334() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US"); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "750x1334_SundownRanchLake_5.png"); Assert.AreEqual(".raids add \"Sundown Ranch Lake\" \"5\" 44:15", text, true); } }
public void Ntx_BottomMenu1080X1920() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US"); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "1080x1920_BottomMenu_CumberlandPresbyterianChurch_Kyogre.png"); Assert.AreEqual(".raids add \"Cumberland Presbyterian Church\" \"Kyogre\" 44:15", text, true); } }
public void CpChecks() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = GetOcrService(context); // Raidboss blocks part of the name - So use the CP information to get the right boss var text = GetOcrResultString(ocrService, "HoOhAsAmonitas.png"); Assert.AreEqual(".raids add \"Steinmann am Rhein \" \"Ho-Oh\" 25:16", text, true); } }
public void NullRefException() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); // The problem here was a to strict BinaryTreshold where the bot would not recognize the gym name anymore var text = GetOcrResultString(ocrService, "NullRefException1.jpg"); Assert.AreEqual(".raids add \"Die Venus in den Büschen\" \"4\" 49:48", text, true); } }
public void BottomMenu720X1280() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BottomMenu854x1717_Egg.png"); Assert.AreEqual(".raids add \"Triple slider\" \"2\" 43:1", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BottomMenu854x1717_Boss.png"); Assert.AreEqual(".raids add \"Spielplatz Erlenmatt\" \"Tyracroc\" 23:12", text, true); } }
public void IPhoneXImageSize() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "IPhoneX-Ei.png"); Assert.AreEqual(".raids add \"The Gate\" \"5\" 28:42", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "IPhoneX-Boss.png"); Assert.AreEqual(".raids add \"The Gate\" \"Latios\" 39:35", text, true); } }
public void BothMenu1080X2220() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "HoOh1080X2220.jpg"); Assert.AreEqual(".raids add \"Warmbacher Kreuz\" \"Ho-Oh\" 25:41", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "BothMenu1080X2220Egg.jpg"); Assert.AreEqual(".raids add \"Jeckenbrunnen\" \"1\" 51:3", text, true); } }
public void WithoutMenuBar1080X1920Correction() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); //TODO: Get a better picture with visible raid timer //var text = GetOcrResult(ocrService, basePath + "Boss1080X2220.jpg", engine); //Assert.AreEqual(".raids add \"The Gate\" \"Sniebel\" ??:31", text, true); var text = GetOcrResultString(ocrService, "WithoutMenu1080x1920.jpg"); Assert.AreEqual(".raids add \"St. Johanns Ring Antique House\" \"2\" 40:13", text, true); } }
public void Interactive() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); // Get the interactive Response var interactiveResult = OcrTestsHelper.GetOcrResult(ocrService, basePath + "Kreuz - Kyogre (Interactive).png"); // The user clicked on the second entry var result = interactiveResult.InterActiveCallbacks.Skip(2).First().Value(); // Raid successfully added var text = result.Result.Message; Assert.AreEqual(".raids add \"Kreuz \" \"Kyogre\" 8:7", text, true); } }
public void WithHotspot750X1334() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = GetOcrResultString(ocrService, "OpenHotSpot750X1334.png"); Assert.AreEqual(".raids add \"Regenbogen Kreis\" \"5\" 52:55", text, true); text = GetOcrResultString(ocrService, "Ntx750X1334WithHotspot.png"); // This a screenshot from a different map, so no chance to find the right gym // But the screenshot is correctly recognized as raid image Assert.AreEqual("8 Arenen gefunden die das Wortfragment \"Leonard\'s Museum\" enthalten. Bitte formuliere den Namen etwas exakter aus, maximal 4 dürfen übrig bleiben für den interaktiven Modus.", text, true); } }
public void BottomMenu720X1280() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = GetOcrResultString(ocrService, "BottomMenu720x1280_Egg.png"); Assert.AreEqual(".raids add \"Triple slider\" \"2\" 43:1", text, true); text = GetOcrResultString(ocrService, "BottomMenu720x1280_Boss.png"); Assert.AreEqual(".raids add \"Spielplatz Erlenmatt\" \"Tyracroc\" 23:12", text, true); text = GetOcrResultString(ocrService, "720x1280Egg5.jpg"); Assert.AreEqual(".raids add \"La Tour De L\'Hôtel De L\'Europe\" \"5\" 10:4", text, true); } }
public void TestMethod1() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = GetOcrService(context); var text = GetOcrResultString(ocrService, "Screenshot_20180519-172950.png"); Assert.AreEqual(".raids add \"Feldschlösschen\" \"Kokowei\" 44:30", text, true); text = GetOcrResultString(ocrService, "Schweizerkreuz_am_Bahnhof.png"); Assert.AreEqual(".raids add \"Schweizerkreuz am Bahnhof\" \"Flunkifer\" 41:29", text, true); text = GetOcrResultString(ocrService, "RestzeitNichtAuswertbar.jpg"); Assert.AreEqual(".raids add \"COOP in Basel\" \"5\" 56:57", text, true); } }
public void GymNameCorrections() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "Jeckenbrunnen.png"); Assert.AreEqual(".raids add \"Jeckenbrunnen\" \"5\" 21:44", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "Monument de Strasbourg.jpg"); Assert.AreEqual(".raids add \"Monument de Strasbourg (Elisabethenanlage)\" \"1\" 21:32", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "Schilderwald - Amonitas.png"); Assert.AreEqual(".raids add \"Schilderwald\" \"Amonitas\" 1:7", text, true); } }
public void BottomMenu1080X2220() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "ZurLandskrone-Karpador.jpg"); Assert.AreEqual(".raids add \"Zur Landskron\" \"Karpador\" 10:1", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "Egg1080X2220Herwig.jpg"); Assert.AreEqual(".raids add \"Skulptur Zwei Schwangere Frauen \" \"4\" 56:54", text, true); text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "GalaxyS9WithMenu2.jpg"); Assert.AreEqual(".raids add \"Rheinfelden Bahnhof\" \"5\" 48:59", text, true); } }
public void BottomMenu1080X2160() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = OcrTestsHelper.GetOcrResultString(ocrService, basePath + "1080x2160Level4Instead5.png"); Assert.AreEqual(".raids add \"des Zeichners Zeichnung\" \"5\" 23:17", text, true); //var interactiveResult = OcrTestsHelper.GetOcrResult(ocrService, basePath + "BottomMenu1080x2160Boss.png"); //var result = interactiveResult.InterActiveCallbacks.First().Value(); //// This gym does not exist in the database so just take one that does to let this test finish successfully //text = result.Result.Message; //Assert.AreEqual(".raids add \"Iron Snail Fountain\" \"Walraisa\" 35:31", text, true); } }
public void Ric1080X2160WithoutBar() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); // The gyms for the following tests do not exist, so just test the results on their own var interactiveResult = GetOcrResult(ocrService, "WithoutBottomBarEgg5.jpg"); Assert.AreEqual(interactiveResult.Result.EggLevel.GetFirst(), 5); Assert.AreEqual(interactiveResult.Result.EggTimer.GetFirst(), new TimeSpan(0, 21, 6)); interactiveResult = GetOcrResult(ocrService, "WithoutBottomBarEgg4.jpg"); Assert.AreEqual(interactiveResult.Result.EggLevel.GetFirst(), 4); Assert.AreEqual(interactiveResult.Result.EggTimer.GetFirst(), new TimeSpan(0, 47, 52)); interactiveResult = GetOcrResult(ocrService, "WithoutBottomBarBossDespotar.jpg"); Assert.AreEqual(interactiveResult.Result.Pokemon.OcrValue, "Despotar"); Assert.AreEqual(interactiveResult.Result.RaidTimer.GetFirst(), new TimeSpan(0, 9, 52)); } }
public void WithoutBar750X1334() { using (var context = new Hydro74000Context(ContextOptions)) { var ocrService = OcrTestsHelper.GetOcrService(ConfigurationService, context); var text = GetOcrResultString(ocrService, "A la Loko - Kyogre.png"); Assert.AreEqual(".raids add \"A la Loko\" \"Kyogre\" 8:7", text, true); text = GetOcrResultString(ocrService, "Absol-Theilsiefje.png"); Assert.AreEqual(".raids add \"Theilsiefje Säule\" \"Absol\" 44:24", text, true); text = GetOcrResultString(ocrService, "750x1334Level5Egg.png"); Assert.AreEqual(".raids add \"Gundeldinger Krippe\" \"5\" 28:15", text, true); text = GetOcrResultString(ocrService, "750x1334Level4Egg.png"); Assert.AreEqual(".raids add \"Big Bicycle\" \"4\" 58:5", text, true); text = GetOcrResultString(ocrService, "750x1334ArenaName.png"); Assert.AreEqual(".raids add \"Baum am Holbeinhof\" \"Regice\" 21:25", text, true); } }