本文整理汇总了C#中IdmResource.GetAttrValues方法的典型用法代码示例。如果您正苦于以下问题:C# IdmResource.GetAttrValues方法的具体用法?C# IdmResource.GetAttrValues怎么用?C# IdmResource.GetAttrValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IdmResource
的用法示例。
在下文中一共展示了IdmResource.GetAttrValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: It_can_GetAttrValues_after_they_have_been_created
public void It_can_GetAttrValues_after_they_have_been_created()
{
var it = new IdmResource
{
Attributes =
new List<IdmAttribute> { new IdmAttribute { Name = "foo", Values = new List<string> { "foo", "bar" } } }
};
var result = it.GetAttrValues("foo");
Assert.AreEqual("foo", result[0]);
Assert.AreEqual("bar", result[1]);
}
示例2: It_can_SetAttrValues_on_an_attribute_that_already_has_values
public void It_can_SetAttrValues_on_an_attribute_that_already_has_values()
{
var it = new IdmResource
{
Attributes =
new List<IdmAttribute> { new IdmAttribute { Name = "foo", Values = new List<string> { "foo", "bar" } } }
};
it.SetAttrValues("foo", new List<string>{"fiz", "buz"});
var result = it.GetAttrValues("foo");
Assert.AreEqual("fiz", result[0]);
Assert.AreEqual("buz", result[1]);
}
示例3: It_should_return_null_for_empty_attributes
public void It_should_return_null_for_empty_attributes()
{
var it = new IdmResource();
Assert.IsNull(it.GetAttr("foo"));
Assert.IsNull(it.GetAttrValue("foo"));
Assert.IsNull(it.GetAttrValues("foo"));
}
示例4: It_can_GettAttr_that_then_allows_modification_of_the_attr
public void It_can_GettAttr_that_then_allows_modification_of_the_attr()
{
var it = new IdmResource
{
Attributes =
new List<IdmAttribute> { new IdmAttribute { Name = "foo", Values = new List<string> { "foo", "bar" } } }
};
var attr = it.GetAttr("foo");
attr.Values.Add("bat");
var result = it.GetAttrValues("foo");
Assert.AreEqual("foo", result[0]);
Assert.AreEqual("bar", result[1]);
Assert.AreEqual("bat", result[2]);
}