using System; namespace NUnit.Util { /// /// TestAgent provides a local representation /// for a RemoteTestAgent allowing the lifetime /// of the remote object to be independent of /// its own. /// public class TestAgent { #region Fields /// /// Reference to the TestAgency that controls this agent /// private TestAgency agency; /// /// This agent's assigned id /// private int agentId; /// /// Reference to the remote agent /// private RemoteTestAgent remoteAgent; #endregion #region Constructor public TestAgent( TestAgency agency, int agentId, RemoteTestAgent remoteAgent ) { this.agency = agency; this.agentId = agentId; this.remoteAgent = remoteAgent; } #endregion #region Properties public TestAgency Agency { get { return agency; } } public int Id { get { return agentId; } } #endregion #region Public Methods public NUnit.Core.TestRunner CreateRunner(int runnerId) { return remoteAgent.CreateRunner( runnerId ); } #endregion } }