Exemplo n.º 1
0
        /// <summary>
        /// Begins a call to the test service to write to the log.
        /// </summary>
        /// <param name="callback">The callback, used to read or verify results
        /// from the service call.</param>
        /// <param name="logName">The name of the log to write.</param>
        /// <param name="content">The log file content.</param>
        public override void WriteLog(Action <ServiceResult> callback, string logName, string content)
        {
            string guid = TestService.UniqueTestRunIdentifier;
            Dictionary <string, string> parameters = string.IsNullOrEmpty(guid) ? WebTestService.Dictionary("logName", logName) : WebTestService.Dictionary("guid", guid, "logName", logName);

            ((SilverlightTestService)TestService).WebService.CallMethod(MethodName_WriteLog, parameters, content, callback);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Save string-based code coverage data.
        /// </summary>
        /// <param name="data">The code coverage data, as a string.</param>
        /// <param name="callback">The callback action.</param>
        public override void SaveCoverageData(string data, Action <ServiceResult> callback)
        {
            string guid = TestService.UniqueTestRunIdentifier;
            Dictionary <string, string> parameters = string.IsNullOrEmpty(guid) ? WebTestService.Dictionary() : WebTestService.Dictionary("guid", guid);

            ((SilverlightTestService)TestService).WebService.CallMethod(MethodName_SaveCodeCoverage, parameters, data, callback);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Begins a call to the test service to report a test run's results.
        /// </summary>
        /// <param name="callback">The callback, used to read or verify results
        /// from the service call.</param>
        /// <param name="failure">A value indicating whether the test run was a
        /// failure.</param>
        /// <param name="failures">The failed scenario count.</param>
        /// <param name="totalScenarios">The total scenario count.</param>
        /// <param name="message">Any message to report along with the failure.</param>
        public override void ReportFinalResult(Action <ServiceResult> callback, bool failure, int failures, int totalScenarios, string message)
        {
            string guid = TestService.UniqueTestRunIdentifier;

            if (string.IsNullOrEmpty(guid))
            {
                Callback(callback, ServiceResult.CreateExceptionalResult(new NotSupportedException("A unique identifier for the test run is required.")));
            }

            Dictionary <string, string> parameters = WebTestService.Dictionary("failure", failure.ToString(CultureInfo.InvariantCulture), "total", totalScenarios.ToString(CultureInfo.InvariantCulture), "failures", failures.ToString(CultureInfo.InvariantCulture), "guid", guid);

            ((SilverlightTestService)TestService).WebService.CallMethod(MethodName_ReportTestResults, parameters, callback);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initialize the web settings provider.
        /// </summary>
        public override void Initialize()
        {
            SetPageTitle("Loading command line parameters...");

            string guid = TestService.UniqueTestRunIdentifier;

            if (string.IsNullOrEmpty(guid))
            {
                base.Initialize();
            }

            ((SilverlightTestService)TestService).WebService.CallMethod(MethodName_GetRunParameters, WebTestService.Dictionary("guid", guid), ReadRunParameters);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Retrieve an environment variable from the system.
 /// </summary>
 /// <param name="name">The variable name.</param>
 /// <param name="callback">The callback action.</param>
 public override void GetEnvironmentVariable(string name, Action <ServiceResult> callback)
 {
     ((SilverlightTestService)TestService).WebService.CallMethod(MethodName_GetEnvironmentVariable, WebTestService.Dictionary("name", name), callback);
 }