示例#1
0
        public TestResults Close(string testId, SessionStopInfo sessionStopInfo)
        {
            SyncTaskListener <TestResults> listener = new SyncTaskListener <TestResults>(logger: Logger, testIds: testId);

            closeService_.Operate(testId, sessionStopInfo, listener);
            return(listener.Get());
        }
        // for testing purposes only
        internal RunningSession StartSession(SessionStartInfo sessionStartInfo)
        {
            SyncTaskListener <RunningSession> listener = new SyncTaskListener <RunningSession>(logger: Logger, testIds: "TEST");

            StartSessionInternal(listener, sessionStartInfo);
            return(listener.Get());
        }
示例#3
0
        public RunningSession Open(string testId, SessionStartInfo sessionStartInfo)
        {
            SyncTaskListener <RunningSession> listener = new SyncTaskListener <RunningSession>(logger: Logger, testIds: testId);

            openService_.Operate(testId, sessionStartInfo, listener);
            RunningSession result = listener.Get();

            if (result == null)
            {
                throw new EyesException("Failed starting session with the server", listener.Exception);
            }
            return(result);
        }
        private Dictionary <T, DeviceSize> GetDevicesSizes_ <T>(string path) where T : struct
        {
            HttpRequestMessage request = CreateUfgHttpWebRequest_(path, method: "GET");
            Dictionary <string, DeviceSize>        sizes            = null;
            SyncTaskListener <HttpResponseMessage> syncTaskListener = new SyncTaskListener <HttpResponseMessage>(
                response =>
            {
                sizes = response.DeserializeBody <Dictionary <string, DeviceSize> >(true);
            });

            httpClient_.SendAsyncRequest(syncTaskListener, request, Logger, new BackoffProvider());
            Logger.Log(TraceLevel.Info, Stage.Open, StageType.RequestCompleted, new { request.RequestUri });
            syncTaskListener.Get();
            return(CommonUtils.ConvertDictionaryKeys <T, DeviceSize>(sizes));
        }
示例#5
0
        public MatchResult Check(string testId, MatchWindowData matchWindowData)
        {
            SyncTaskListener listener = new SyncTaskListener(logger: Logger, testIds: testId);

            checkService_.TryUploadImage(testId, matchWindowData, listener);

            bool?result = listener.Get();

            if (result == null || result.Value == false)
            {
                throw new EyesException("Failed performing match with the server", listener.Exception);
            }

            SyncTaskListener <MatchResult> matchListener = new SyncTaskListener <MatchResult>(logger: Logger, testIds: testId);

            checkService_.MatchWindow(testId, matchWindowData, matchListener);
            return(matchListener.Get());
        }