本文整理汇总了C#中Data._Inspect方法的典型用法代码示例。如果您正苦于以下问题:C# Data._Inspect方法的具体用法?C# Data._Inspect怎么用?C# Data._Inspect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data._Inspect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetFrom
public void SetFrom()
{
var data = new Data() { IntField = 1, StrField = "one" };
var dict = data._AsDictionary();
dict["IntField"] = 11;
// Should change IntField to 11
data._SetFrom(dict);
Assert.AreEqual("([IntField,11],[StrField,one])", data._Inspect());
}
示例2: SetFrom_CaseInsensitive
public void SetFrom_CaseInsensitive()
{
var data = new Data() { IntField = 1, StrField = "one" };
var lowerData = new LowerData() { intField = 2, strField = "two" };
// This shouldn't work, because the default is to have names match exactly
data._SetFrom(lowerData, true);
Assert.AreEqual("([IntField,1],[StrField,one])", data._Inspect());
// Should change IntField to 2
data._SetFrom(lowerData, false);
Assert.AreEqual("([IntField,2],[StrField,two])", data._Inspect());
}
示例3: AsDictionary
public void AsDictionary()
{
var data = new Data() { IntField = 1, StrField = "a" };
Assert.AreEqual("([IntField,1],[StrField,a])", data._Inspect());
}