protected override void ProcessEmptyData(BaseRecord record, Hashtable table) { //All basic values were set by BaseRunner already, so we simply add it to our list AssetRecord rec = new AssetRecord(record); _results.Add(rec); }
protected override void ProcessFailure(BaseRecord record) { //All basic values were set by BaseRunner already, so we simply add it to our list AssetRecord rec = new AssetRecord(record); _results.Add(rec); }
private void ConclusionIsConsistent(AssetRecord Record) { //A assent can only have the state Success (Has Value), DoesNotApply (Has No Value) or Fatal (Error) Assert.True(Record.Conclusion == ConclusionEnum.DoesNotApply | Record.Conclusion == ConclusionEnum.Success | Record.Conclusion == ConclusionEnum.Fatal, "Wrong Conclusion value for: " + Record.ToString()); }
private void ConclusionMatchesOtherFields(AssetRecord Record) { if (Record.Conclusion == ConclusionEnum.Success) { ConclusionMatchesOtherFields_ForSuccess(Record); } if (Record.Conclusion == ConclusionEnum.DoesNotApply) { ConclusionMatchesOtherFields_ForDoesNotApply(Record); } if (Record.Conclusion == ConclusionEnum.Fatal) { ConclusionMatchesOtherFields_ForFatal(Record); } }
protected override void ProcessNonEmptyData(BaseRecord record, Hashtable table, string dataKeyValue) { AssetRecord assetRecord = new AssetRecord(record); //Data is set = Conclusion.Success assetRecord.Conclusion = ConclusionEnum.Success; assetRecord.Data = dataKeyValue; //Check the object that was returned and copy it to .DataNative (if we support the type) object dataObjectFromHashtable = GetObjectFromHashtable(table, Xteq5EngineConstant.ReturnedHashtableKeyData); if (dataObjectFromHashtable is string) { //String is the default of .Data. Therefore no action is required } else { if (dataObjectFromHashtable is bool) { assetRecord.DataNative = (Boolean)dataObjectFromHashtable; } else { if (dataObjectFromHashtable is int) { assetRecord.DataNative = (int)dataObjectFromHashtable; } else { if (dataObjectFromHashtable is System.Version) { assetRecord.DataNative = dataObjectFromHashtable as System.Version; } } } } _results.Add(assetRecord); }
//Called by this class for each asset that exists. Imlementation must add the content to the given stringbuilder. protected abstract void ProcessAsset(StringBuilder sbAssets, AssetRecord asset, BaseRecord baseRec, ResultPrimarySecondary resultPrimSecond);
protected override void ProcessAsset(StringBuilder sbAssets, AssetRecord asset, BaseRecord baseRec, ResultPrimarySecondary resultPrimSecond) { sbAssets.AppendLine(CreateTableRow(baseRec, resultPrimSecond)); }
private void ConclusionMatchesOtherFields_ForSuccess(AssetRecord Record) { //If the Conclusion is success, both name and value must be filled Assert.False(string.IsNullOrWhiteSpace(Record.Name), "Name is empty in " + Record.ToString()); Assert.False(string.IsNullOrWhiteSpace(Record.Data), "Data is empty in " + Record.ToString()); }
private void ConclusionMatchesOtherFields_ForFatal(AssetRecord Record) { //If the Conclusion is Fatal, Name must be set but value must be empty Assert.False(string.IsNullOrWhiteSpace(Record.Name), "Name is empty in " + Record.ToString()); Assert.True(string.IsNullOrWhiteSpace(Record.Data), "Data is set in " + Record.ToString()); }
private void FieldsAreNotNull(AssetRecord Record) { Assert.True(Record.Name != null, "Name is null in " + Record.ToString()); Assert.True(Record.Data != null, "Data is null in " + Record.ToString()); Assert.True(Record.ScriptFilePath != null, "ScriptFilename is null in " + Record.ToString()); Assert.True(Record.ProcessMessages != null, "ProcessMessages is null in " + Record.ToString()); }