예제 #1
0
        public static UIImage AssertColorAtPoint(this UIImage bitmap, UIColor expectedColor, int x, int y)
        {
            try
            {
                var cap = bitmap.ColorAtPoint(x, y);

                if (!ColorComparison.ARGBEquivalent(cap, expectedColor))
                {
                    System.Diagnostics.Debug.WriteLine("Here");
                }

                Assert.That(cap, Is.EqualTo(expectedColor).Using <UIColor>(ColorComparison.ARGBEquivalent),
                            () => bitmap.CreateColorAtPointError(expectedColor, x, y));

                return(bitmap);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }

            return(null);
        }