예제 #1
0
        /// <summary>
        /// Saves the settings.
        /// </summary>
        /// <remarks>Classes that inherit from SettingsProvider: hide this
        /// function.  Do not call up through to this base method.</remarks>
        /// <param name="callback">The service callback.</param>
        public virtual void SaveSettings(Action <ServiceResult> callback)
        {
            // TODO: resources
            string message = IsReadOnly ? "Settings cannot be saved, they are read only." : "Save is not implemented.";

            Callback(callback, ServiceResult.CreateExceptionalResult(new NotSupportedException(message)));
        }
예제 #2
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);
        }
예제 #3
0
        /// <summary>
        /// Saves the current settings values.
        /// </summary>
        /// <param name="callback">The service completion callback.</param>
        public override void SaveSettings(Action <ServiceResult> callback)
        {
            ServiceResult result;

            try
            {
                if (_settings != null)
                {
                    _settings.Save();
                }

                result = null;
            }
            catch (IsolatedStorageException e)
            {
                result = ServiceResult.CreateExceptionalResult(e);
            }
            callback(result);
        }
예제 #4
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 virtual void SaveCoverageData(string data, Action <ServiceResult> callback)
 {
     Callback(callback, ServiceResult.CreateExceptionalResult(new NotSupportedException("This feature is not currently supported.")));
 }
예제 #5
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 virtual void ReportFinalResult(Action <ServiceResult> callback, bool failure, int failures, int totalScenarios, string message)
 {
     Callback(callback, ServiceResult.CreateExceptionalResult(new NotSupportedException()));
 }
예제 #6
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 virtual void WriteLog(Action <ServiceResult> callback, string logName, string content)
 {
     Callback(callback, ServiceResult.CreateExceptionalResult(new NotSupportedException()));
 }
예제 #7
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 virtual void GetEnvironmentVariable(string name, Action <ServiceResult> callback)
 {
     Callback(callback, ServiceResult.CreateExceptionalResult(new NotSupportedException("Environment is not yet implemented.")));
 }