コード例 #1
0
        public void ScopeExtensions_SearchScope_ReturnsNullIfNoSuccess()
        {
            MockScope scope  = new MockScope();
            Scope     result = ScopeExtensions.SearchScope <TestChildScope>(scope);

            Assert.Null(result);
        }
コード例 #2
0
        public void ScopeExtensions_SearchScope_ReturnsCurrentScopeIfSearchTypeMatches()
        {
            MockScope scope  = new MockScope();
            MockScope result = ScopeExtensions.SearchScope <MockScope>(scope);

            Assert.Equal(scope, result);
        }
コード例 #3
0
        public void ScopeExtensions_SearchScope_MakesReqursiveCallForChildScope()
        {
            MockScope  parent     = new MockScope();
            ChildScope childScope = new TestChildScope(parent);

            MockScope result = ScopeExtensions.SearchScope <MockScope>(childScope);

            Assert.Equal(parent, result);
        }
コード例 #4
0
        public void ScopeExtensions_SearchScope_MakesReqursiveCallForBindScope()
        {
            MockScope parent     = new MockScope();
            MockScope grandChild = new MockScope();
            BindScope bindScope  = new BindScope(parent, grandChild);

            MockScope result = ScopeExtensions.SearchScope <MockScope>(bindScope);

            Assert.Equal(grandChild, result);
        }
コード例 #5
0
 public void ScopeExtensions_SearchScope_RequiresScopeObject()
 {
     Assert.Throws <ArgumentNullException>(() => ScopeExtensions.SearchScope <Scope>(null));
 }
コード例 #6
0
ファイル: ScopeExtensionsTests.cs プロジェクト: taiab/nledger
 public void ScopeExtensions_SearchScope_RequiresScopeObject()
 {
     ScopeExtensions.SearchScope <Scope>(null);
 }