Exemplo n.º 1
0
        public AuditEventPolicySubcategoriesProberTest()
        {
            var fakeItem = new auditeventpolicysubcategories_item();

            FakeCollectInfo    = GetFakeCollectInfo("oval:modulo:obj:2000");
            FakeCollectedItems = new CollectedItem[] { ProbeHelper.CreateFakeCollectedItem(fakeItem) };
            FakeItemsToCollect = new ItemType[] { fakeItem };
        }
Exemplo n.º 2
0
        private string GetSubcategoryValue(auditeventpolicysubcategories_item itemType, AuditEventSubcategories subcategoryName)
        {
            var subCategoryField    = itemType.GetType().GetProperty(subcategoryName.ToString());
            var itemValueField      = subCategoryField.GetValue(itemType, null);
            var itemValueFieldValue = itemValueField.GetType().GetProperty("Value");

            return(itemValueFieldValue.GetValue(itemValueField, null).ToString());
        }
 private void MapAuditEventSubcategoriesDictionaryToItemType(
     Dictionary <AuditEventSubcategories, AuditEventStatus> auditEventPolicySubcategories, auditeventpolicysubcategories_item systemItem)
 {
     foreach (var entry in auditEventPolicySubcategories)
     {
         var field      = systemItem.GetType().GetProperty(entry.Key.ToString());
         var fieldValue = field.GetValue(systemItem, null);
         var childField = fieldValue.GetType().GetProperty("Value");
         childField.SetValue(fieldValue, entry.Value.ToString(), null);
     }
 }