Esempio n. 1
0
        public void OffsetPatternToScript_ShouldReturnRightString()
        {
            var pathToTestPic = Path.GetFullPath(@"..\..\..\Utils\vs.png");
            var pattern       = new FileImage(pathToTestPic, 0.3);
            var point         = new Point(5, 5);
            var offsetPattern = new OffsetImage(pattern, point);

            var actualResult = offsetPattern.ToSikuliScript("click", 0);

            actualResult.Should()
            .Be(
                $@"print ""SIKULI#: YES"" if click(Pattern({"\"" + pathToTestPic + "\""}).similar(0.3).targetOffset(5, 5)) else ""SIKULI#: NO""");
        }
Esempio n. 2
0
        public void DoubleClickWithOffset_InvokePattern_WithRightCommand()
        {
            var offset        = new Point(5, 5);
            var offsetImage   = new OffsetImage(_image, offset);
            var sikuliCommand = offsetImage.ToSikuliScript("doubleClick", 0);

            _mockRuntime.Setup(r => r.Run(sikuliCommand, 0)).Callback(() => _invokeCount++);

            IScreen screen = new Screen(_mockRuntime.Object);

            screen.DoubleClick(_image, offset);

            _invokeCount.Should().Be(1);
        }