CreateExceptionalResult() public static method

Creates a new ServiceResult object for a failed result, the sets the exception.
public static CreateExceptionalResult ( Exception except ) : ServiceResult
except System.Exception The Exception object.
return ServiceResult
        /// <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);
        }
 /// <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.")));
 }
Esempio 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 virtual void ReportFinalResult(Action <ServiceResult> callback, bool failure, int failures, int totalScenarios, string message)
 {
     Callback(callback, ServiceResult.CreateExceptionalResult(new NotSupportedException()));
 }
Esempio n. 4
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()));
 }
 /// <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.")));
 }
Esempio n. 6
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)
        {
            string message = IsReadOnly ? "Settings cannot be saved, they are read only." : "Save is not implemented.";

            Callback(callback, ServiceResult.CreateExceptionalResult(new NotSupportedException(message)));
        }