/***************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
This code is licensed under the Visual Studio SDK license terms.
THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
***************************************************************************/
//*************************************************************************************************
// MyTestResult.cs
//
// This file defines the MyTestResult class.
//
// Copyright(c) Microsoft Corporation, 2004
//*************************************************************************************************
namespace Microsoft.VisualStudio.TestTools.Samples
{
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.TestTools.Common;
using Microsoft.VisualStudio.TestTools.Exceptions;
/// <summary>
/// MyTest TestResult implementation.
/// Derive your own TestResult class when you have additional result
/// information to store for each test that's run. TestResult objects
/// can be used later by a details result viewer to display your
/// own result information to the user.
/// </summary>
[Serializable]
internal sealed class MyTestResult: TestResult
{
#region Constructors
/// <summary>
/// Default constructor needed for persistence
/// </summary>
private MyTestResult()
{ }
/// <summary>
/// Constructor, taking default info and passing it to the base class
/// NB: "Default" outcome, is "Not Run"
/// </summary>
/// <param name="computerInfo">Information about the system the test was run on</param>
/// <param name="runId">The run with which this result is associated</param>
/// <param name="test">The actual test to which this result applies</param>
public MyTestResult(ComputerInfo computerInfo, Guid runId, MyTest test)
: base(computerInfo, runId, test)
{ }
/// <summary>
/// This defines the copy constructor to help with passing around result objects
/// </summary>
/// <param name="copy">The result to be copied</param>
private MyTestResult(MyTestResult copy)
: base(copy)
{
m_processExitCode = copy.m_processExitCode; // Deep copy the exit code
}
#endregion
#region Properties
[UserVisibleProperty("{7982FC42-E338-4564-B58F-DC97ECEA96DC}")]
[TestCaseManagementDisplayName(typeof(Properties.Resources), "ProcessExitCodeDisplayName")]
[DefaultValue(0)]
public int ProcessExitCode2
{
get { return m_processExitCode; }
set { m_processExitCode = value; }
}
#endregion
#region Overrides
/// <summary>
/// Privides clone functionality
/// </summary>
/// <returns>A Copy of this result object</returns>
public override object Clone()
{
return new MyTestResult(this);
}
#endregion
#region Private data
[PersistenceElementName("ProcessExitCode2")]
private int m_processExitCode;
#endregion
}
}