// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using ICSharpCode.NRefactory.Utils;
using ICSharpCode.SharpDevelop.Dom;
namespace ICSharpCode.UnitTesting
{
///
/// Represents a unit test or a group of unit tests.
///
public interface ITest
{
///
/// Gets the collection of nested tests.
///
IModelCollection NestedTests { get; }
///
/// Gets whether this test allows expanding the list of nested tests.
/// If possible, this property should return the same value as NestedTests.Count.
/// However, when doing so is expensive (e.g. due to lazy initialization), this
/// property may return true even if there are no nested tests.
///
bool CanExpandNestedTests { get; }
///
/// Gets the parent project that owns this test.
///
ITestProject ParentProject { get; }
///
/// Name to be displayed in the tests tree view.
///
string DisplayName { get; }
///
/// Raised when the property changes.
///
event EventHandler DisplayNameChanged;
///
/// Gets the result of the previous run of this test.
///
TestResultType Result { get; }
///
/// Raised when the property changes.
///
event EventHandler ResultChanged;
///
/// Resets the test results for this test and all nested tests.
///
void ResetTestResults();
///
/// Retrieves the path to the specified test, if it is a descendant of this test.
/// Returns null if the specified test is not a descendant.
/// Returns an empty stack if this is the test we are searching for.
/// The top-most element on the stack (=first when enumerating the stack) will be
/// a direct child of this test.
///
ImmutableStack FindPathToDescendant(ITest test);
System.Windows.Input.ICommand GoToDefinition { get; }
}
}