public void ScopeExtensions_SearchScope_ReturnsNullIfNoSuccess() { MockScope scope = new MockScope(); Scope result = ScopeExtensions.SearchScope <TestChildScope>(scope); Assert.Null(result); }
public void ScopeExtensions_SearchScope_ReturnsCurrentScopeIfSearchTypeMatches() { MockScope scope = new MockScope(); MockScope result = ScopeExtensions.SearchScope <MockScope>(scope); Assert.Equal(scope, result); }
public void ScopeExtensions_SearchScope_MakesReqursiveCallForChildScope() { MockScope parent = new MockScope(); ChildScope childScope = new TestChildScope(parent); MockScope result = ScopeExtensions.SearchScope <MockScope>(childScope); Assert.Equal(parent, result); }
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); }
public void ScopeExtensions_SearchScope_RequiresScopeObject() { Assert.Throws <ArgumentNullException>(() => ScopeExtensions.SearchScope <Scope>(null)); }
public void ScopeExtensions_SearchScope_RequiresScopeObject() { ScopeExtensions.SearchScope <Scope>(null); }