本文整理汇总了C#中RegexWizard.Framework.Scope.FindScopesInRange方法的典型用法代码示例。如果您正苦于以下问题:C# Scope.FindScopesInRange方法的具体用法?C# Scope.FindScopesInRange怎么用?C# Scope.FindScopesInRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RegexWizard.Framework.Scope
的用法示例。
在下文中一共展示了Scope.FindScopesInRange方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindScopesInRange_SomeNestedScopesToFindAndOneDirectScopeToFind
public void FindScopesInRange_SomeNestedScopesToFindAndOneDirectScopeToFind()
{
Scope root = new Scope("012345");
root.DefineInnerScope(3, 1);//middle scope
root.DefineInnerScope(2, 1);//inside left scope
root.DefineInnerScope(4, 1);//inside right scope
List<Scope> found = root.FindScopesInRange(2, 3);
Assert.AreEqual("2", found[0].Text);
Assert.AreEqual("3", found[1].Text);
Assert.AreEqual("4", found[2].Text);
}
示例2: FindScopesInRange_TwoScopes_ReturnsOnlyFullyEncapsulatedScopes
public void FindScopesInRange_TwoScopes_ReturnsOnlyFullyEncapsulatedScopes()
{
Scope root = new Scope("012345");
root.DefineInnerScope(1, 1);
List<Scope> found = root.FindScopesInRange(0, 3);
Assert.AreEqual(2,found.Count);
Assert.AreEqual(root.InnerLeftScope, found[0]);//0
Assert.AreEqual(root.InnerMiddleScope, found[1]);//1
}
示例3: FindScopesInRange_SingleScope_ReturnsIt
public void FindScopesInRange_SingleScope_ReturnsIt()
{
Scope root = new Scope("012345");
List<Scope> found = root.FindScopesInRange(0, 6);
Assert.AreEqual(found[0],root);
}
示例4: FindScopesInRange_SingleScopeInsideInnerRight_ReturnsOnlyFullyEncapsulatedScope
public void FindScopesInRange_SingleScopeInsideInnerRight_ReturnsOnlyFullyEncapsulatedScope()
{
Scope root = new Scope("0123456789");
Scope inner = root.DefineInnerScope(0, 3);//012
root.DefineInnerScope(7, 2);//78 which is inside 3456789
List<Scope> found = root.FindScopesInRange(6, 3);//6(78)
Assert.AreEqual(found[0],root.InnerRightScope.InnerMiddleScope);
}
示例5: FindScopesInRange_SingleScopeInsideInnerMiddle_ReturnsOnlyFullyEncapsulatedScope
public void FindScopesInRange_SingleScopeInsideInnerMiddle_ReturnsOnlyFullyEncapsulatedScope()
{
Scope root = new Scope("0123456789");
Scope inner = root.DefineInnerScope(1, 7);//1234567
inner.DefineInnerScope(4, 2);// 45
List<Scope> found = root.FindScopesInRange(3, 3);//3(45)
Assert.AreEqual(found[0],root.InnerMiddleScope.InnerMiddleScope);
}
示例6: FindScopesInRange_SingleScopeInsideInnerLeft_ReturnsOnlyFullyEncapsulatedScope
public void FindScopesInRange_SingleScopeInsideInnerLeft_ReturnsOnlyFullyEncapsulatedScope()
{
Scope root = new Scope("012345");
Scope inner = root.DefineInnerScope(0, 5);//01234
inner.DefineInnerScope(2, 2);// 23
List<Scope> found = root.FindScopesInRange(1, 3);//123
Assert.AreEqual(found[0],root.InnerLeftScope.InnerMiddleScope);
}
示例7: FindScopesInRange_SingleScopeInnerRight_ReturnsOnlyFullyEncapsulatedScope
public void FindScopesInRange_SingleScopeInnerRight_ReturnsOnlyFullyEncapsulatedScope()
{
Scope root = new Scope("012345");
root.DefineInnerScope(5, 1);
List<Scope> found = root.FindScopesInRange(3, 3);
Assert.AreEqual(found[0], root.InnerRightScope);
}