本文整理汇总了C#中IdmResource.SetAttrValue方法的典型用法代码示例。如果您正苦于以下问题:C# IdmResource.SetAttrValue方法的具体用法?C# IdmResource.SetAttrValue怎么用?C# IdmResource.SetAttrValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IdmResource
的用法示例。
在下文中一共展示了IdmResource.SetAttrValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: It_should_be_able_to_set_string_based_single_value_properties
public void It_should_be_able_to_set_string_based_single_value_properties()
{
var it = new IdmResource();
it.ObjectID = "foo";
Assert.AreEqual("foo", it.ObjectID);
it.ObjectType = "foo";
Assert.AreEqual("foo", it.ObjectType);
it.Description = "foo";
Assert.AreEqual("foo", it.Description);
it.DisplayName = "foo";
Assert.AreEqual("foo", it.DisplayName);
it.MVObjectID = "foo";
Assert.AreEqual("foo", it.MVObjectID);
it.Locale = "foo";
Assert.AreEqual("foo", it.Locale);
// and attributes
it.SetAttrValue("foo", "bar");
Assert.AreEqual("bar", it.GetAttrValue("foo"));
}
示例2: It_can_SettAttrValue_nullable_null_value_and_come_back_as_null_as_either_Value_or_ToInt
public void It_can_SettAttrValue_nullable_null_value_and_come_back_as_null_as_either_Value_or_ToInt()
{
var it = new IdmResource();
it.SetAttrValue("foo", null);
var result1 = it.GetAttrValue("foo");
var result2 = it.GetAttr("foo").ToInteger();
var result3 = it.GetAttr("foo").ToDateTime();
var result4 = it.GetAttr("foo").ToBinary();
var result5 = it.GetAttr("foo").ToBool();
Assert.IsNull(result1);
Assert.IsNull(result2);
Assert.IsNull(result3);
Assert.IsNull(result4);
Assert.IsNull(result5);
}
示例3: It_doesnt_end_up_with_superflous_attributes_by_calling_SetAttrValue
public void It_doesnt_end_up_with_superflous_attributes_by_calling_SetAttrValue()
{
// Arrange
var it = new IdmResource { Description = "foo" };
var attrCountBefore = it.Attributes.Count;
it.SetAttrValue("Description", "bar");
it.SetAttrValue("Description", "bar");
it.SetAttrValue("Description", "bar");
var attrCountAfter = it.Attributes.Count;
Assert.AreEqual(attrCountBefore, attrCountAfter);
}
示例4: It_can_SetAttrValue_on_an_attribute_that_already_has_a_value
public void It_can_SetAttrValue_on_an_attribute_that_already_has_a_value()
{
var it = new IdmResource { Description = "foo" };
it.SetAttrValue("Description", "bar");
Assert.AreEqual("bar", it.Description);
}