public void TestGetQuizPattern() { // All water Bitmap sourceImage = new Bitmap(quizImgDir + "\\1.png"); string pattern = QuizSolver.GetQuizPattern(sourceImage, 1920, 1080); Assert.AreEqual(QuizSolver.ALL_WATER, pattern); }
private string TryGetQuizPattern() { string pattern = string.Empty; for (int i = 0; i < 3; i++) { pattern = QuizSolver.GetQuizPattern(Emulator.PrintWindow(), Emulator.Width, Emulator.Height); if (!string.IsNullOrEmpty(pattern)) { break; } } return(pattern); }
public void TestCorrectAnswerAngelmon() { string testScreenPath = quizImgDir + "\\2.png"; Bitmap testScreen = new Bitmap(testScreenPath); string quizPattern = QuizSolver.GetQuizPattern(testScreen, 1920, 1080); Assert.AreEqual(QuizSolver.ANGELMON, quizPattern); string actual = ""; for (int i = 1; i <= 8; i++) { (Point point, Bitmap img)answer = QuizSolver.GetAnswer(testScreen, i); if (QuizSolver.IsCorrectAnswer(answer, quizPattern, 1920, 1080)) { actual += i; //emulator.Click(answer.point); } } string expected = "136"; Assert.AreEqual(expected, actual); }
public void TestCorrectAnswerEllia() { string testScreenPath = quizImgDir + "\\9.png"; Bitmap testScreen = new Bitmap(testScreenPath); string quizPattern = QuizSolver.GetQuizPattern(testScreen, 1280, 720); Assert.AreEqual(QuizSolver.ELLIA, quizPattern); string actual = ""; for (int i = 1; i <= 8; i++) { (Point point, Bitmap img)answer = QuizSolver.GetAnswer(testScreen, i); if (QuizSolver.IsCorrectAnswer(answer, quizPattern, 1280, 720)) { actual += i; //emulator.Click(answer.point); } } string expected = "35"; Assert.AreEqual(expected, actual); }