public TestLink(Guid id, string name, string storage) { if (id == Guid.Empty) { throw new ArgumentException("ID cant be empty"); } EqtAssert.StringNotNullOrEmpty(name, "name"); EqtAssert.ParameterNotNull(storage, "storage"); this.id = id; this.name = name; this.storage = storage; }
/// <summary> /// Saves the class under the XmlElement. /// </summary> /// <param name="element"> /// The parent xml. /// </param> /// <param name="parameters"> /// The parameter /// </param> public void Save(XmlElement element, XmlTestStoreParameters parameters) { EqtAssert.ParameterNotNull(element, "element"); XmlPersistence helper = new XmlPersistence(); helper.SaveSimpleField(element, ".", this.description, null); // The URI is not a true URI, it must always be a local path represented as a URI. Also, the URI can be absolute or // relative. We use OriginalString because: // - ToString gets a string in the form "file://..." for an absolute URI and what was passed in for a relative URI // - AbsoluteUri only works for an absolute URI naturally // - LocalPath only works for an absolute URI // Due to the above assumption, that it is always an absolute or relative local path to a file, it's simplest and // safest to treat the URI as a string and just use OriginalString. helper.SaveSimpleField(element, "@href", this.uri.OriginalString, null); }
private void Initialize(Uri uri, string collectorDisplayName, string agentName, string agentDisplayName, bool isFromRemoteAgent, IEnumerable <IDataAttachment> attachments) { EqtAssert.ParameterNotNull(uri, "uri"); EqtAssert.StringNotNullOrEmpty(collectorDisplayName, "collectorDisplayName"); EqtAssert.StringNotNullOrEmpty(agentName, "agentName"); EqtAssert.StringNotNullOrEmpty(agentDisplayName, "agentDisplayName"); if (null != attachments) { // Copy the attachments foreach (IDataAttachment attachment in attachments) { this.AddAttachment(attachment); } } // Note that the data can be null. this.uri = uri; this.collectorDisplayName = collectorDisplayName; this.agentName = agentName.Trim(); this.agentDisplayName = agentDisplayName.Trim(); this.isFromRemoteAgent = isFromRemoteAgent; }
/// <summary> /// WARNING: do not use from inside Test Adapters, use from only on HA by UI etc. /// Returns directory on HA for dependent files for TestResult. XmlPersistence method for UI. /// Throws on error (e.g. if deployment directory was not set for test run). /// </summary> /// <param name="result"> /// Test Result to get dependent files directory for. /// </param> /// <returns> /// Result directory. /// </returns> internal string GetResultFilesDirectory(UnitTestResult result) { EqtAssert.ParameterNotNull(result, "result"); return(Path.Combine(this.GetResultsDirectory(), result.RelativeTestResultsDirectory)); }
/// <summary> /// Helper function to add a text message info to the test result /// </summary> /// <param name="text">Message to be added</param> public void AddTextMessage(string text) { EqtAssert.ParameterNotNull(text, "text"); this.textMessages.Add(text); }
/// <summary> /// Adds the workitem. /// </summary> /// <param name="item">WorkItem to be added.</param> public override void Add(WorkItem item) { EqtAssert.ParameterNotNull(item, nameof(item)); base.Add(item); }
/// <summary> /// Used internally for fake uncategorized category. /// </summary> /// <param name="name"> /// Category name. /// </param> /// <param name="id"> /// Category id. /// </param> /// <param name="parentId"> /// The parent Id. /// </param> private TestListCategory(string name, TestListCategoryId id, TestListCategoryId parentId) : this(name, parentId) { EqtAssert.ParameterNotNull(id, "id"); this.id = id; }
/// <summary> /// The assign code base. /// </summary> /// <param name="cb"> /// The code base. /// </param> public void AssignCodeBase(string cb) { EqtAssert.StringNotNullOrEmpty(cb, "codeBase"); this.codeBase = cb; }