本文整理汇总了C#中DataDictionary.Get方法的典型用法代码示例。如果您正苦于以下问题:C# DataDictionary.Get方法的具体用法?C# DataDictionary.Get怎么用?C# DataDictionary.Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataDictionary
的用法示例。
在下文中一共展示了DataDictionary.Get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Get_NoItemAdded_ReturnsNull
public void Get_NoItemAdded_ReturnsNull()
{
var dd = new DataDictionary ();
string res = dd.Get ("foobar");
Assert.IsNull (res);
}
示例2: Get_DifferentKeyAdded_ReturnsNull
public void Get_DifferentKeyAdded_ReturnsNull()
{
var dd = new DataDictionary ();
dd.Set ("blizbar", "baz");
string res = dd.Get ("foobar");
Assert.IsNull (res);
}
示例3: Get_EmptyChildrenAdded_ReturnsNull
public void Get_EmptyChildrenAdded_ReturnsNull()
{
var dd = new DataDictionary ();
dd.Children.Add (new DataDictionary ());
dd.Children.Add (new DataDictionary ());
string res = dd.Get ("foobar");
Assert.IsNull (res);
}
示例4: Get_NameSetInChild_ReturnsItem
public void Get_NameSetInChild_ReturnsItem()
{
var dd = new DataDictionary ();
var child = new DataDictionary ();
dd.Children.Add (child);
child.Set ("foobar", "baz");
string res = dd.Get ("foobar");
Assert.AreEqual ("baz", res);
}
示例5: Get_MultipleChildrenWithKey_ReturnsFirstChildAdded
public void Get_MultipleChildrenWithKey_ReturnsFirstChildAdded()
{
var dd = new DataDictionary ();
var child = new DataDictionary ();
dd.Children.Add (child);
child.Set ("foobar", "baz");
child = new DataDictionary ();
dd.Children.Add (child);
child.Set ("foobar", "blahh");
child = new DataDictionary ();
dd.Children.Add (child);
child.Set ("foobar", "bork");
string res = dd.Get ("foobar");
Assert.AreEqual ("baz", res);
}
示例6: Get_NameSet_ReturnsItem
public void Get_NameSet_ReturnsItem()
{
var dd = new DataDictionary ();
dd.Set ("foobar", "baz");
string res = dd.Get ("foobar");
Assert.AreEqual ("baz", res);
}