本文整理汇总了C#中Set.Evaluate方法的典型用法代码示例。如果您正苦于以下问题:C# Set.Evaluate方法的具体用法?C# Set.Evaluate怎么用?C# Set.Evaluate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Set
的用法示例。
在下文中一共展示了Set.Evaluate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckSelectBool
public void CheckSelectBool()
{
var tag = new Set();
tag.Select = new MockAttribute(new Constant("/results/var[@id=\"1\"]/value"));
tag.Source = new MockAttribute(new Constant("xml"));
tag.Var = new MockAttribute(new Constant("result"));
tag.Evaluate(_model);
Assert.That(_model["result"], Is.True);
}
示例2: CheckSelectFirstWithPosition
public void CheckSelectFirstWithPosition()
{
var tag = new Set();
tag.Select = new MockAttribute(new Constant("/results/var[position()=last()]/value"));
tag.Source = new MockAttribute(new Constant("xml"));
tag.Var = new MockAttribute(new Constant("result"));
tag.Evaluate(_model);
Assert.That(_model["result"] is XPathNavigator, Is.True);
Assert.That(((XPathNavigator) _model["result"]).Value, Is.EqualTo("*"));
}
示例3: CheckSelectNodeList
public void CheckSelectNodeList()
{
var tag = new Set();
tag.Select = new MockAttribute(new Constant("/results/*"));
tag.Source = new MockAttribute(new Constant("xml"));
tag.Var = new MockAttribute(new Constant("result"));
tag.Evaluate(_model);
Assert.That(_model["result"] is XPathNodeIterator);
}
示例4: CheckSelectNode
public void CheckSelectNode()
{
var tag = new Set();
tag.Select = new MockAttribute(new Constant("results/var[@id=\"3\"]/value"));
tag.Source = new MockAttribute(new Constant("xml"));
tag.Var = new MockAttribute(new Constant("result"));
tag.Evaluate(_model);
Assert.That(_model["result"] is XPathNavigator, Is.True);
Assert.That(((XPathNavigator) _model["result"]).Value, Is.EqualTo("*"));
}
示例5: CheckSelectNumber
public void CheckSelectNumber()
{
var tag = new Set();
tag.Select = new MockAttribute(new Constant("/results/var[@id=\"2\"]/value"));
tag.Source = new MockAttribute(new Constant("xml"));
tag.Var = new MockAttribute(new Constant("result"));
tag.Evaluate(_model);
Assert.That(_model["result"], Is.EqualTo(45.4m));
}