Пример #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);
        }
Пример #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);
        }
Пример #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());
 }
Пример #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);
            }
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
Пример #8
0
 protected override void ProcessAsset(StringBuilder sbAssets, AssetRecord asset, BaseRecord baseRec, ResultPrimarySecondary resultPrimSecond)
 {
     sbAssets.AppendLine(CreateTableRow(baseRec, resultPrimSecond));
 }
Пример #9
0
 protected override void ProcessAsset(StringBuilder sbAssets, AssetRecord asset, BaseRecord baseRec, ResultPrimarySecondary resultPrimSecond)
 {
     sbAssets.AppendLine(CreateTableRow(baseRec, resultPrimSecond));
 }
Пример #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());
 }
Пример #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());
 }
Пример #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());
 }
Пример #13
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);
Пример #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);
 }
Пример #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);
 }