Beispiel #1
0
        public void ScreenCapturePositions()
        {
            var bmp = new Bitmap("RankedDetection/TestFiles/Screen768_8-8.jpg");
            var rd  = RankDetection.Match(bmp).Result;

            Assert.IsTrue(rd.Success);
            Assert.AreEqual(8, rd.Player);
            Assert.AreEqual(8, rd.Opponent);
        }
Beispiel #2
0
 static void Main(string[] args)
 {
     if (args.Length == 3)
     {
         if (args[0].ToLower() == "create")
         {
             RankTemplate.Create(args[1], args[2]);
         }
         else if (args[0].ToLower() == "match")
         {
             RankDetection.SetTemplateLocation(args[1]);
             var match = RankDetection.Match(new Bitmap(args[2]), true);
             System.Console.WriteLine(match);
         }
     }
 }
Beispiel #3
0
        public void RankedFriendsList_IsNotSuccessful()
        {
            var result = RankDetection.Match(new Bitmap(@"data\HsGameRankedFriends.png"));

            Assert.IsFalse(result.Success);
        }
Beispiel #4
0
        public void MenuB_IsNotSuccessful()
        {
            var result = RankDetection.Match(new Bitmap(@"data\HsMenuB.png"));

            Assert.IsFalse(result.Success);
        }
Beispiel #5
0
        public void NonRankedGame_IsNotSuccessful()
        {
            var result = RankDetection.Match(new Bitmap(@"data\HsGameAi.png"));

            Assert.IsFalse(result.Success);
        }
Beispiel #6
0
        // Helper Methods

        private bool TestCapture(string height, int ply = 8, int opp = 8)
        {
            var result = RankDetection.Match(new Bitmap(@"data\Height_" + height + ".png"));

            return(result.Player == ply && result.Opponent == opp);
        }
Beispiel #7
0
 public static void Setup(TestContext context)
 {
     _result = RankDetection.Match(new Bitmap(@"data\LegendGame.png"));
 }
Beispiel #8
0
 public static void Setup(TestContext context)
 {
     _resultHi = RankDetection.Match(new Bitmap(@"data\Ranked_14_14_Hi.png"));
     _resultLo = RankDetection.Match(new Bitmap(@"data\Ranked_14_14_Lo.png"));
 }