本文整理汇总了C#中Spring.Objects.Factory.Config.ConstructorArgumentValues.GetIndexedArgumentValue方法的典型用法代码示例。如果您正苦于以下问题:C# ConstructorArgumentValues.GetIndexedArgumentValue方法的具体用法?C# ConstructorArgumentValues.GetIndexedArgumentValue怎么用?C# ConstructorArgumentValues.GetIndexedArgumentValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spring.Objects.Factory.Config.ConstructorArgumentValues
的用法示例。
在下文中一共展示了ConstructorArgumentValues.GetIndexedArgumentValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetIndexedArgumentValue
public void GetIndexedArgumentValue()
{
ConstructorArgumentValues values = new ConstructorArgumentValues();
Assert.IsNull(values.GetIndexedArgumentValue(0, typeof (object)), "Mmm... managed to get a non null instance back from an empty instance.");
values.AddIndexedArgumentValue(16, DBNull.Value, typeof (DBNull).FullName);
Assert.IsNull(values.GetIndexedArgumentValue(0, typeof (object)), "Mmm... managed to get a non null instance back from an instance that should have now't at the specified index.");
ConstructorArgumentValues.ValueHolder value =
values.GetIndexedArgumentValue(16, typeof (DBNull));
Assert.IsNotNull(value, "Stored a value at a specified index, but got null when retrieving it.");
Assert.AreSame(DBNull.Value, value.Value, "The value stored at the specified index was not the exact same instance as was added.");
ConstructorArgumentValues.ValueHolder wrongValue =
values.GetIndexedArgumentValue(16, typeof (string));
Assert.IsNull(wrongValue, "Stored a value at a specified index, and got it (or rather something) back when retrieving it with the wrong Type specified.");
}