Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
 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());
 }
Example #4
0
        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);
            }
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }
Example #7
0
 //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);
Example #8
0
 protected override void ProcessAsset(StringBuilder sbAssets, AssetRecord asset, BaseRecord baseRec, ResultPrimarySecondary resultPrimSecond)
 {
     sbAssets.AppendLine(CreateTableRow(baseRec, resultPrimSecond));
 }
Example #9
0
 protected override void ProcessAsset(StringBuilder sbAssets, AssetRecord asset, BaseRecord baseRec, ResultPrimarySecondary resultPrimSecond)
 {
     sbAssets.AppendLine(CreateTableRow(baseRec, resultPrimSecond));
 }
Example #10
0
 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());
 }
Example #11
0
 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());
 }
Example #12
0
 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());
 }
 //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);
Example #14
0
 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);
 }
Example #15
0
 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);
 }