本文整理匯總了C#中Modulo.Collect.OVAL.SystemCharacteristics.ItemType.Single方法的典型用法代碼示例。如果您正苦於以下問題:C# ItemType.Single方法的具體用法?C# ItemType.Single怎麽用?C# ItemType.Single使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Modulo.Collect.OVAL.SystemCharacteristics.ItemType
的用法示例。
在下文中一共展示了ItemType.Single方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AssertGeneratedWmiItem
private void AssertGeneratedWmiItem(ItemType[] itemToAssert, string expectedNamespace, string expectedWql)
{
ItemTypeChecker.DoBasicAssertForItems(itemToAssert, 1, typeof(wmi_item));
var wmiItemToAssert = (wmi_item)itemToAssert.Single();
ItemTypeEntityChecker.AssertItemTypeEntity([email protected], expectedNamespace);
ItemTypeEntityChecker.AssertItemTypeEntity(wmiItemToAssert.wql, expectedWql);
}
示例2: AssertFileItem
private void AssertFileItem(ItemType[] itemsToAssert, string expectedPath, string expectedFilename, bool filepathMustBeNull)
{
ItemTypeChecker.DoBasicAssertForItems(itemsToAssert, 1, TypeOfUnixFileItem);
var fileItemToAssert = (OVAL.SystemCharacteristics.Unix.file_item)itemsToAssert.Single();
if (filepathMustBeNull)
{
Assert.IsNull(fileItemToAssert.filepath);
ItemTypeEntityChecker.AssertItemTypeEntity(fileItemToAssert.path, expectedPath);
if (!string.IsNullOrEmpty(expectedFilename))
ItemTypeEntityChecker.AssertItemTypeEntity(fileItemToAssert.filename, expectedFilename);
}
else
{
var expectedFilepath = string.Format("{0}{1}", expectedPath, expectedFilename);
ItemTypeEntityChecker.AssertItemTypeEntity(fileItemToAssert.filepath, expectedFilepath);
Assert.AreEqual(String.Empty, fileItemToAssert.path.Value);
Assert.AreEqual(String.Empty, fileItemToAssert.filename.Value);
}
}