本文整理汇总了C#中RegexWizard.Framework.Scope.DefineInnerScope方法的典型用法代码示例。如果您正苦于以下问题:C# Scope.DefineInnerScope方法的具体用法?C# Scope.DefineInnerScope怎么用?C# Scope.DefineInnerScope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RegexWizard.Framework.Scope
的用法示例。
在下文中一共展示了Scope.DefineInnerScope方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DefineInnerScope_InCombinedParentOfTwoInners_SetsRootScopeOnInner
public void DefineInnerScope_InCombinedParentOfTwoInners_SetsRootScopeOnInner()
{
Scope root = new Scope("0123456789");
Scope parent = root.DefineInnerScope(5, 4);
//5678
Scope combinedParent = root.DefineInnerScope(5, 5);//5678+9
Scope innerChild = root.DefineInnerScope(6, 2);//67
Assert.AreEqual(combinedParent.InnerLeftScope, innerChild.ParentScope);
Assert.AreEqual(combinedParent, combinedParent.InnerLeftScope.ParentScope);
Assert.AreEqual(combinedParent, combinedParent.InnerRightScope.ParentScope);
}
示例2: DefineInnerScope_WithleftMiddleandRightScopesasInner
public void DefineInnerScope_WithleftMiddleandRightScopesasInner()
{
Scope root = new Scope("012345");
root.DefineInnerScope(3, 1);//012|3|45
ScopeSplitter splitter = new ScopeSplitter();
splitter.AutoSplit(root, 2, 3, true);//01|(2|3|4)|5
Scope encapsulator = root.DefineInnerScope(2, 3);
Assert.AreEqual("2", encapsulator.InnerLeftScope.Text);
Assert.AreEqual("3", encapsulator.InnerMiddleScope.Text);
Assert.AreEqual("4", encapsulator.InnerRightScope.Text);
}
示例3: SetInnerScope_EncapsulatingInnerScopes_CreatesOuterScopeWithInnerScopes
public void SetInnerScope_EncapsulatingInnerScopes_CreatesOuterScopeWithInnerScopes()
{
Scope root = new Scope("abcd");
root.DefineInnerScope(1, 1);//b
root.DefineInnerScope(2, 1);//'c' as inner of 'cd'
Scope encapsulating = root.DefineInnerScope(1, 2);//'b'+'c' splitting 'd' to an implicit scope
Assert.AreEqual("bc", encapsulating.Text);
}
示例4: SetInnerScope_WithScopeInTheEnd_DoesntSetInnerMiddleScope
public void SetInnerScope_WithScopeInTheEnd_DoesntSetInnerMiddleScope()
{
scope = new Scope("abc");
Scope newone = scope.DefineInnerScope(2, 1);
Assert.IsNull(scope.InnerMiddleScope);
}
示例5: SetInnerScope_SetsParentCorrectlyRightScope
public void SetInnerScope_SetsParentCorrectlyRightScope()
{
Scope rootScope = new Scope("abc");
rootScope.DefineInnerScope(1, 1);
Assert.AreSame(rootScope, rootScope.InnerRightScope.ParentScope);
}
示例6: SetInnerScope_SetsInnerRightScopePropertyToRightScope2
public void SetInnerScope_SetsInnerRightScopePropertyToRightScope2()
{
scope = new Scope("defge");
scope.DefineInnerScope(2, 1);
Scope rightScopeWithCorrectProperties = new Scope("ge", 3);
rightScopeWithCorrectProperties.IsExplicit = false;
Assert.IsTrue(rightScopeWithCorrectProperties.Equals(scope.InnerRightScope));
}
示例7: Scope
public void DefineInnerScope_WithleftMiddleandRightScopesasInner_RemovesOriginalScopesFromDirectRootAndIntoNewScope()
{
Scope root = new Scope("012");
root.DefineInnerScope(1, 1);//1
root.InnerRightScope.Suggestions.Add(new Suggestion("a","b"));
root.InnerMiddleScope.Suggestions.Add(new Suggestion("a","b"));
Scope encapsulator = root.DefineInnerScope(0, 2);//01
Assert.AreEqual("0", encapsulator.InnerLeftScope.Text);
Assert.AreEqual(null, encapsulator.InnerMiddleScope);
Assert.AreEqual("1", encapsulator.InnerRightScope.Text);
Assert.AreEqual("2", root.InnerRightScope.Text);
Assert.AreEqual("01", root.InnerLeftScope.Text);
Assert.AreEqual(null, root.InnerMiddleScope);
Assert.AreEqual(1, root.InnerRightScope.Suggestions.Count);
Assert.AreEqual(1, encapsulator.InnerRightScope.Suggestions.Count);
Assert.AreEqual(encapsulator, encapsulator.InnerRightScope.ParentScope);
Assert.AreEqual(encapsulator, encapsulator.InnerLeftScope.ParentScope);
}
示例8: SetInnerScope_SetsInnerLeftScopePropertyToLeftScope2
public void SetInnerScope_SetsInnerLeftScopePropertyToLeftScope2()
{
scope = new Scope("defg");
scope.DefineInnerScope(2, 1);
Scope leftScopeWithCorrectProperties = new Scope("de", 0);
leftScopeWithCorrectProperties.IsExplicit = false;
Assert.IsTrue(leftScopeWithCorrectProperties.Equals(scope.InnerLeftScope));
}
示例9: SetInnerScope_SameScopeAsParent_ThrowsExcpetion
public void SetInnerScope_SameScopeAsParent_ThrowsExcpetion()
{
scope = new Scope("abc");
Scope inner = scope.DefineInnerScope(0, 3);
}
示例10: SetInnerScope_OnFirstCharInInnerScope_InnerInnerLeftScopeTextIsOK
public void SetInnerScope_OnFirstCharInInnerScope_InnerInnerLeftScopeTextIsOK()
{
scope = new Scope("a text b");
scope.DefineInnerScope(1, 5);//' text'
scope.DefineInnerScope(1, 1);//' ' inside inner middle scope
Assert.AreEqual(" ", scope.InnerMiddleScope.InnerLeftScope.Text);
}
示例11: SetInnerScope_IsFlat_CreatesTwoExtraScopesIfScopeIsInTheMiddle2
public void SetInnerScope_IsFlat_CreatesTwoExtraScopesIfScopeIsInTheMiddle2()
{
scope = new Scope("abcd");
Scope inner = scope.DefineInnerScope(1, 2);
Scope[] innerScopes = scope.GetInnerScopes();
Assert.AreEqual(3, innerScopes.Length);
}
示例12: SetInnerScope_IsFlat_CreatesOneExtraScopesIfScopeIsInTheEnd
public void SetInnerScope_IsFlat_CreatesOneExtraScopesIfScopeIsInTheEnd()
{
scope = new Scope("abc");
Scope inner = scope.DefineInnerScope(2, 1);
Scope[] innerScopes = scope.GetInnerScopes();
Assert.AreEqual(2, innerScopes.Length);
}
示例13: SetInnerScope_IfInnerScopeExists_DoesNotThrowsException
public void SetInnerScope_IfInnerScopeExists_DoesNotThrowsException()
{
scope = new Scope("abc");
scope.DefineInnerScope(0, 1);
scope.DefineInnerScope(2, 1);
}
示例14: SetInnerScope_EncapsulatingInnerScopes_CreatesRightImplicitScopeSplitted
public void SetInnerScope_EncapsulatingInnerScopes_CreatesRightImplicitScopeSplitted()
{
Scope root = new Scope("abcd");
root.DefineInnerScope(1, 1);//b
Assert.AreEqual("cd", root.InnerRightScope.Text);
Scope encapsulating = root.DefineInnerScope(1, 2);//'b'+'c' splitting 'd' to an implicit scope
Assert.AreEqual("d", root.InnerRightScope.Text);
Assert.AreEqual("bc", root.InnerMiddleScope.Text);
Assert.AreEqual(true, root.InnerRightScope.IsImplicit);
Assert.AreEqual("b", encapsulating.InnerLeftScope.Text);
Assert.AreEqual("c", encapsulating.InnerRightScope.Text);
}
示例15: SetInnerScope_EncapsulatingInnerScopes_CreatesOuterScopeWithInnerScopes2
public void SetInnerScope_EncapsulatingInnerScopes_CreatesOuterScopeWithInnerScopes2()
{
Scope root = new Scope("abcd");
root.DefineInnerScope(1, 1);//b
root.DefineInnerScope(2, 1);//'c' as inner of 'cd'
Scope encapsulating = root.DefineInnerScope(1, 3);//'bcd'
Assert.AreEqual("bcd", encapsulating.Text);
}